From 61222fc55b3da1cfdfafd0c8d5d3e00501752a60 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Wed, 11 Dec 2002 22:37:05 +0000 Subject: [PATCH] Fixed subtle bug where 'make prefix=/somewhere; make clean; make prefix=/somwhere/else' produced an executable using the incorrect library directories. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4186 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Source/Modules/Makefile.in | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Source/Modules/Makefile.in b/Source/Modules/Makefile.in index 2b705395b..ba894e5c4 100644 --- a/Source/Modules/Makefile.in +++ b/Source/Modules/Makefile.in @@ -5,6 +5,13 @@ srcdir = @srcdir@ VPATH = @srcdir@ +# prefix is needed for swig_lib +prefix = @prefix@ +exec_prefix = @exec_prefix@ +release_suffix = @release_suffix@ +swig_lib = @swig_lib@ +libdir = @libdir@ + SHELL = /bin/sh CXX = @CXX@ CFLAGS = @CFLAGS@ @SWILL@ @@ -12,6 +19,10 @@ YACC = @YACC@ AR = @AR@ RANLIB = @RANLIB@ +# These C macros are passed on the compilation command line as autoconf won't expand them for +# generation into a header file. This is because they can be set when running make. +DEFS = -DSWIG_LIB=\"$(swig_lib)\" -DLIBDIR=\"$(libdir)\" -DRELEASE_SUFFIX=\"$(release_suffix)\" + TARGET = libmodules.a OBJS = main.@OBJEXT@ module.@OBJEXT@ emit.@OBJEXT@ overload.@OBJEXT@ lang.@OBJEXT@ typepass.@OBJEXT@ allocate.@OBJEXT@ browser.@OBJEXT@ contract.@OBJEXT@ swigmain.@OBJEXT@ tcl8.@OBJEXT@ python.@OBJEXT@ perl5.@OBJEXT@ guile.@OBJEXT@ ruby.@OBJEXT@ mzscheme.@OBJEXT@ java.@OBJEXT@ php4.@OBJEXT@ ocaml.@OBJEXT@ xml.@OBJEXT@ pike.@OBJEXT@ s-exp.@OBJEXT@ SRCS = main.cxx module.cxx emit.cxx overload.cxx lang.cxx typepass.cxx allocate.cxx browser.cxx contract.cxx swigmain.cxx tcl8.cxx python.cxx perl5.cxx guile.cxx ruby.cxx mzscheme.cxx java.cxx php4.cxx ocaml.cxx xml.cxx pike.cxx s-exp.cxx @@ -25,7 +36,7 @@ INCLUDES = -I$(srcdir)/../Include \ # Rules for creation of a .@OBJEXT@ file from .cxx .SUFFIXES: .cxx .cxx.@OBJEXT@: - $(CXX) $(INCLUDES) $(CFLAGS) -c -o $*.@OBJEXT@ $< + $(CXX) $(DEFS) $(INCLUDES) $(CFLAGS) -c -o $*.@OBJEXT@ $< swig: $(TARGET)