Single makefile for building SWIG executable

Automake used to build SWIG executable
Tidied up make install
Bug fixes in installation when using ./configure --with-release-suffix and autoconf's EXEEXT.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4219 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2002-12-23 22:47:06 +00:00
commit b88a7bfa05

View file

@ -12,49 +12,20 @@ libdir = @libdir@
##############################################################################
SHELL = /bin/sh
CC = @CC@
CFLAGS = @CFLAGS@
CXX = @CXX@
LIBS = @LIBS@
SWIGLIBS = @SWIGLIBS@
AR = @AR@
RANLIB = @RANLIB@
# Note: Files in `SWIG_LIB' are machine independent so we use `prefix'
# instead of `exec_prefix' or, derivatively, `libdir'.
SWIG_LIB = @swig_lib@
BIN_DIR = @bindir@
TARGET = swig@release_suffix@
TARGET = swig@release_suffix@@EXEEXT@
SOURCE = Source
SOURCEDIRS = `ls $(SOURCE)`
swig: Modules Swig Preprocessor CParse DOH runtime swig.spec
$(CXX) -o $(TARGET) \
$(SOURCE)/Modules/libmodules.a \
$(SOURCE)/CParse/libcparse.a \
$(SOURCE)/Preprocessor/libcpp.a \
$(SOURCE)/Swig/libswig.a \
$(SOURCE)/DOH/libdoh.a @SWIGLIBS@
swig: source runtime swig.spec
Modules: Source/Include/swigconfig.h
@cd $(SOURCE)/Modules; $(MAKE)
Swig: Source/Include/swigconfig.h
@cd $(SOURCE)/Swig; $(MAKE)
Preprocessor: Source/Include/swigconfig.h
@cd $(SOURCE)/Preprocessor; $(MAKE)
CParse: Source/Include/swigconfig.h
@cd $(SOURCE)/CParse; $(MAKE)
source:
@cd $(SOURCE); $(MAKE)
swig.spec: swig.spec.in config.status
@CONFIG_HEADERS= CONFIG_LINKS= CONFIG_FILES=swig.spec $(SHELL) ./config.status
DOH: Source/Include/swigconfig.h
@cd $(SOURCE)/DOH; $(MAKE)
.PHONY: SWIG1.1 Modules Swig Preprocessor DOH runtime
.PHONY: source runtime
#####################################################################
# All the languages SWIG speaks (when it wants to)
@ -211,22 +182,25 @@ check: check-aliveness check-examples check-gifplot check-test-suite
clean: clean-objects clean-examples clean-gifplot clean-test-suite
clean-objects:
@for i in $(SOURCEDIRS) ; \
do \
echo cleaning $(SOURCE)/$$i; \
if [ -d $(SOURCE)/$$i -a -f $(SOURCE)/$$i/Makefile ]; then \
(cd $(SOURCE)/$$i; $(MAKE) -s clean) ; \
fi \
done;
@echo cleaning Runtime
@cd Runtime; $(MAKE) -s clean
clean-objects: clean-source clean-runtime
clean-source:
@echo cleaning Source
@cd $(SOURCE); $(MAKE) -s clean
@rm -f $(TARGET)
distclean-dead = config.status config.log config.cache swig.spec \
@configure_substituted_files@
distclean-source:
@echo dist cleaning Source
@cd $(SOURCE); $(MAKE) -s distclean
@rm -f $(TARGET)
distclean: clean
clean-runtime:
@echo cleaning Runtime
@cd Runtime; $(MAKE) -s clean
distclean-dead = config.status config.log config.cache swig.spec Makefile mkmf.log
distclean: distclean-source clean-runtime clean-examples clean-gifplot clean-test-suite
rm -f $(distclean-dead)
clean-examples:
@ -262,20 +236,19 @@ install: install-main install-lib install-runtime
@echo "Installation complete"
install-main:
@echo "Installing $(BIN_DIR)/swig"
@echo "Installing SWIG executable"
@$(MKINSTDIRS) $(DESTDIR)$(BIN_DIR)
@if [ -f swig.exe ]; then swig=swig.exe; else swig=$(TARGET); fi; \
$(INSTALL_PROGRAM) $$swig $(DESTDIR)$(BIN_DIR)/$$swig
@echo "Installing $(BIN_DIR)/$(TARGET)"
@$(INSTALL_PROGRAM) $(TARGET) $(DESTDIR)$(BIN_DIR)/$(TARGET)
lib-languages = tcl perl5 python guile java mzscheme ruby php4 ocaml pike
install-lib:
@echo "Installing the SWIG library"
@$(MKINSTDIRS) $(DESTDIR)$(SWIG_LIB)
# cd $(SWIG_LIB); rm -rf *
@cd $(srcdir)/Lib; for i in *.i *.swg; \
do \
echo "Installing Lib/$$i"; \
echo "Installing $(DESTDIR)$(SWIG_LIB)/$$i"; \
../$(INSTALL_DATA) $$i $(DESTDIR)$(SWIG_LIB)/$$i; \
done;
@for lang in $(lib-languages); \
@ -293,7 +266,7 @@ install-lib:
echo "Installing nothing from Lib/$$lang"; \
else for file in $$doti $$dotswg $$extra; \
do \
echo "Installing Lib/$$lang/$$file"; \
echo "Installing $$dst/$$file"; \
../../$(INSTALL_DATA) $$file $$dst/$$file; \
done; \
fi ); \
@ -312,12 +285,8 @@ uninstall: uninstall-main uninstall-lib uninstall-runtime
@echo "Uninstall complete"
uninstall-main:
@echo "Uninstalling $(BIN_DIR)/swig"
@if [ -f swig.exe ]; then \
rm -f $(DESTDIR)$(BIN_DIR)/swig.exe; \
else \
rm -f $(DESTDIR)$(BIN_DIR)/$(TARGET); \
fi
@echo "Uninstalling $(BIN_DIR)/$(TARGET)"
rm -f $(DESTDIR)$(BIN_DIR)/$(TARGET);
uninstall-lib:
@echo "Uninstalling the SWIG library"