Big changes. The makefiles now recurse correctly, and targets (e.g.
experiment, swim, swig, pymod, etc.) are passed along to sub-makes correctly. Also, a mechanism has been devised to avoid the use of *.o in the toplevel Makefile, as it was linking files which were not intended for use in the final executable. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@148 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
f0d2cf2a9e
commit
d2c40e1b17
10 changed files with 171 additions and 73 deletions
|
|
@ -1,2 +1,3 @@
|
|||
Makefile
|
||||
y.tab.*
|
||||
config.cache config.log config.status configure
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
#####################################################################
|
||||
# LParse
|
||||
#####################################################################
|
||||
|
||||
# Generated automatically from Makefile.in by configure.
|
||||
|
||||
CC = @CC@
|
||||
|
|
@ -14,12 +18,17 @@ YACC = @YACC@
|
|||
INCLUDE = -I. -I../Swig -I../DOH/Include -I../Preprocessor
|
||||
|
||||
SRCS = cscanner.c type.c
|
||||
OBJS = cscanner.o type.o
|
||||
OBJS = parser.o cscanner.o type.o
|
||||
|
||||
.c.o:
|
||||
$(CC) $(CCSHARED) $(INCLUDE) $(CFLAGS) -c -o $*.o $<
|
||||
|
||||
all: parser.o $(OBJS)
|
||||
#####################################################################
|
||||
# TARGET: experiment
|
||||
#####################################################################
|
||||
# friendly to the toplevel makefile
|
||||
experiment: $(OBJS)
|
||||
for i in $(OBJS); do echo Source/LParse/$$i >> $(OBJS_FILE); done
|
||||
|
||||
parser.o: parser.c
|
||||
$(CC) $(CCSHARED) $(INCLUDE) $(CFLAGS) -c -o $*.o $<
|
||||
|
|
|
|||
|
|
@ -48,9 +48,13 @@ SHELL = /bin/sh
|
|||
.cxx.o:
|
||||
$(CC) $(INCLUDE) $(CFLAGS) -c -o $*.o $<
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET): $(WRAPOBJS)
|
||||
#####################################################################
|
||||
# TARGET: swig
|
||||
#####################################################################
|
||||
# friendly to the toplevel makefile
|
||||
all: swig
|
||||
swig: $(WRAPOBJS)
|
||||
for i in $(WRAPOBJS); do echo Source/Modules1.1/$$i >> $(OBJS_FILE); done
|
||||
|
||||
clean::
|
||||
rm -f *.o *~
|
||||
|
|
|
|||
|
|
@ -17,7 +17,13 @@ OBJS = expr.o cpp.o
|
|||
.c.o:
|
||||
$(CC) $(CCSHARED) $(INCLUDE) $(CFLAGS) -c -o $*.o $<
|
||||
|
||||
all: $(OBJS)
|
||||
#####################################################################
|
||||
# TARGET: swig
|
||||
#####################################################################
|
||||
# friendly to the toplevel makefile
|
||||
all: swig
|
||||
swig: $(OBJS)
|
||||
for i in $(OBJS); do echo Source/Preprocessor/$$i >> $(OBJS_FILE); done
|
||||
|
||||
clean:
|
||||
rm -f *.o *~ core *.so *.a
|
||||
|
|
|
|||
|
|
@ -52,6 +52,8 @@ INCLUDE = -I../Include -I. -I../Swig -I../Preprocessor -I../DOH/Include
|
|||
CFLAGS = @CFLAGS@ -DSWIG_LIB='"$(SWIG_LIB)"' -DSWIG_CC='"$(CC)"' @DEFS@
|
||||
SHELL = /bin/sh
|
||||
|
||||
OBJS = parser.o $(LIBOBJS)
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
|
|
@ -60,7 +62,13 @@ SHELL = /bin/sh
|
|||
.cxx.o:
|
||||
$(CC) $(INCLUDE) $(CFLAGS) -c -o $*.o $<
|
||||
|
||||
all: parser.o $(LIBOBJS)
|
||||
#####################################################################
|
||||
# TARGET: swig
|
||||
#####################################################################
|
||||
# friendly to the toplevel makefile
|
||||
all: swig
|
||||
swig: $(OBJS)
|
||||
for i in $(OBJS); do echo Source/SWIG1.1/$$i >> $(OBJS_FILE); done
|
||||
|
||||
parser.o: parser.cxx $(LIBHEADERS)
|
||||
$(CC) $(INCLUDE) $(CFLAGS) parser.cxx -c -o parser.o
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
#----------------------------------------------------------------
|
||||
|
||||
SRCS = types.c scanner.c include.c getopt.c misc.c super.c
|
||||
OBJS = $(SRCS:.c=.o)
|
||||
INTERFACE = swig.i
|
||||
WRAPFILE = $(INTERFACE:.i=_wrap.c)
|
||||
WRAPOBJ = $(INTERFACE:.i=_wrap.o)
|
||||
|
|
@ -46,11 +47,6 @@ SWIGCC = $(CC)
|
|||
# SWIG Library files. Uncomment if rebuilding the Python interpreter
|
||||
#SWIGLIB = -lembed.i
|
||||
|
||||
# Rules for creating .o files from source.
|
||||
|
||||
OBJS = $(SRCS:.c=.o)
|
||||
ALLOBJS = $(OBJS)
|
||||
|
||||
# Command that will be used to build the final extension.
|
||||
BUILD = $(SWIGCC)
|
||||
|
||||
|
|
@ -82,7 +78,15 @@ BUILD_LIBS = $(LIBS) # Dynamic loading
|
|||
# Toplevel Targets
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
all: $(OBJS) # the object files
|
||||
######################################################################
|
||||
# TARGET: swig
|
||||
#####################################################################
|
||||
# note that here we echo the names of all of our object files,
|
||||
# relative to the project root, into $(OBJS_FILE), for compatibility
|
||||
# with the parent makefile.
|
||||
all: swig
|
||||
swig: $(OBJS)
|
||||
for i in $(OBJS); do echo Source/Swig/$$i >> $(OBJS_FILE); done
|
||||
|
||||
python: $(TARGET) # the python module
|
||||
|
||||
|
|
@ -104,5 +108,5 @@ $(WRAPFILE) : $(INTERFACE)
|
|||
$(SWIG) $(SWIGOPT) -o $(WRAPFILE) $(SWIGLIB) $(INTERFACE)
|
||||
|
||||
$(TARGET): $(WRAPOBJ) $(ALLOBJS)
|
||||
$(BUILD) $(WRAPOBJ) $(ALLOBJS) $(BUILD_LIBS) -o $(TARGET)
|
||||
$(BUILD) $(WRAPOBJ) $(OBJS) $(BUILD_LIBS) -o $(TARGET)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue