1 # Generated automatically from Makefile.in by configure.
2 # ---------------------------------------------------------------
6 # This file can be used to build various Python extensions with SWIG.
7 # By default this file is set up for dynamic loading, but it can
8 # be easily customized for static extensions by modifying various
9 # portions of the file.
11 # SRCS = C source files
12 # CXXSRCS = C++ source files
13 # OBJCSRCS = Objective-C source files
14 # OBJS = Additional .o files (compiled previously)
15 # INTERFACE = SWIG interface file
16 # TARGET = Name of target module or executable
18 # Many portions of this file were created by the SWIG configure
19 # script and should already reflect your machine.
20 #----------------------------------------------------------------
27 WRAPFILE = $(INTERFACE:.i=_wrap.c)
28 WRAPOBJ = $(INTERFACE:.i=_wrap.o)
29 TARGET = module.so # Use this kind of target for dynamic loading
30 #TARGET = mypython # Use this target for static linking
33 exec_prefix = ${prefix}
37 OBJC = cc -Wno-import # -Wno-import needed for gcc
43 # SWIG = location of the SWIG executable
44 # SWIGOPT = SWIG compiler options
45 # SWIGCC = Compiler used to compile the wrapper file
47 SWIG = $(exec_prefix)/bin/swig
51 # SWIG Library files. Uncomment if rebuilding the Python interpreter
54 # Rules for creating .o files from source.
57 CXXOBJS = $(CXXSRCS:.cxx=.o)
58 OBJCOBJS = $(OBJCSRCS:.m=.o)
59 ALLOBJS = $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(OBJS)
61 # Command that will be used to build the final extension.
64 # Uncomment the following if you are using dynamic loading
68 # Uncomment the following if you are using dynamic loading with C++ and
69 # need to provide additional link libraries (this is not always required).
71 #DLL_LIBS = -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.7.2 \
72 -L/usr/local/lib -lg++ -lstdc++ -lgcc
74 # X11 installation (needed if rebuilding Python + tkinter)
76 XLIB = -L/usr/openwin/lib -lX11
77 XINCLUDE = -I/usr/openwin/include
81 PY_INCLUDE = -DHAVE_CONFIG_H -I/usr/local/include/python1.5 -I/usr/local/lib/python1.5/config
82 PY_LIB = /usr/local/lib/python1.5/config
84 # Tcl installation. Needed if rebuilding Python with tkinter.
86 TCL_INCLUDE = -I/usr/local/include
87 TCL_LIB = -L/usr/local/lib
89 # Build libraries (needed for static builds)
93 SYSLIBS = $(LIBM) $(LIBC) -lsocket -lnsl -ldl
95 # Build options (uncomment only one these)
97 #TKINTER = $(TCL_LIB) -ltk -ltcl $(XLIB)
98 BUILD_LIBS = $(LIBS) # Dynamic loading
99 #BUILD_LIBS = $(PY_LIB) -lpython1.5 $(TKINTER) $(LIBS) $(SYSLIBS)
101 # Compilation rules for non-SWIG components
103 .SUFFIXES: .c .cxx .m
106 $(CC) $(CCSHARED) $(CFLAGS) $(INCLUDE) -c $<
109 $(CXX) $(CCSHARED) $(CXXFLAGS) $(INCLUDE) -c $<
112 $(OBJC) $(CCSHARED) $(CFLAGS) $(INCLUDE) -c $<
115 # ----------------------------------------------------------------------
116 # Rules for building the extension
117 # ----------------------------------------------------------------------
121 # Convert the wrapper file into an object file
123 $(WRAPOBJ) : $(WRAPFILE)
124 $(SWIGCC) -c $(CCSHARED) $(CFLAGS) $(WRAPFILE) $(INCLUDE) $(PY_INCLUDE)
126 $(WRAPFILE) : $(INTERFACE)
127 $(SWIG) $(SWIGOPT) -o $(WRAPFILE) $(SWIGLIB) $(INTERFACE)
129 $(TARGET): $(WRAPOBJ) $(ALLOBJS)
130 $(BUILD) $(WRAPOBJ) $(ALLOBJS) $(BUILD_LIBS) -o $(TARGET)
133 rm -f $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(WRAPOBJ) $(WRAPFILE) $(TARGET)