OLD | NEW |
(Empty) | |
| 1 # --------------------------------------------------------------- |
| 2 # SWIG Python Makefile |
| 3 # |
| 4 # This file can be used to build various Python extensions with SWIG. |
| 5 # By default this file is set up for dynamic loading, but it can |
| 6 # be easily customized for static extensions by modifying various |
| 7 # portions of the file. |
| 8 # |
| 9 # SRCS = C source files |
| 10 # CXXSRCS = C++ source files |
| 11 # OBJCSRCS = Objective-C source files |
| 12 # OBJS = Additional .o files (compiled previously) |
| 13 # INTERFACE = SWIG interface file |
| 14 # TARGET = Name of target module or executable |
| 15 # |
| 16 # Many portions of this file were created by the SWIG configure |
| 17 # script and should already reflect your machine. |
| 18 #---------------------------------------------------------------- |
| 19 |
| 20 SRCS = |
| 21 CXXSRCS = |
| 22 OBJCSRCS = |
| 23 OBJS = |
| 24 INTERFACE = |
| 25 WRAPFILE = $(INTERFACE:.i=_wrap.c) |
| 26 WRAPOBJ = $(INTERFACE:.i=_wrap.o) |
| 27 TARGET = module@SO@ # Use this kind of target for dynamic loading |
| 28 #TARGET = mypython # Use this target for static linking |
| 29 |
| 30 prefix = @prefix@ |
| 31 exec_prefix = @exec_prefix@ |
| 32 |
| 33 CC = @CC@ |
| 34 CXX = @CXX@ |
| 35 OBJC = @CC@ -Wno-import # -Wno-import needed for gcc |
| 36 CFLAGS = |
| 37 INCLUDES = |
| 38 LIBS = |
| 39 |
| 40 # SWIG Options |
| 41 # SWIG = location of the SWIG executable |
| 42 # SWIGOPT = SWIG compiler options |
| 43 # SWIGCC = Compiler used to compile the wrapper file |
| 44 |
| 45 SWIG = $(exec_prefix)/bin/swig |
| 46 SWIGOPT = -python |
| 47 SWIGCC = $(CC) |
| 48 |
| 49 # SWIG Library files. Uncomment if rebuilding the Python interpreter |
| 50 #SWIGLIB = -lembed.i |
| 51 |
| 52 # Rules for creating .o files from source. |
| 53 |
| 54 COBJS = $(SRCS:.c=.o) |
| 55 CXXOBJS = $(CXXSRCS:.cxx=.o) |
| 56 OBJCOBJS = $(OBJCSRCS:.m=.o) |
| 57 ALLOBJS = $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(OBJS) |
| 58 |
| 59 # Command that will be used to build the final extension. |
| 60 BUILD = $(SWIGCC) |
| 61 |
| 62 # Uncomment the following if you are using dynamic loading |
| 63 CCSHARED = @CCSHARED@ |
| 64 BUILD = @LDSHARED@ |
| 65 |
| 66 # Uncomment the following if you are using dynamic loading with C++ and |
| 67 # need to provide additional link libraries (this is not always required). |
| 68 |
| 69 #DLL_LIBS = -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.7.2 \ |
| 70 -L/usr/local/lib -lg++ -lstdc++ -lgcc |
| 71 |
| 72 # X11 installation (needed if rebuilding Python + tkinter) |
| 73 |
| 74 XLIB = @XLIBSW@ |
| 75 XINCLUDE = @XINCLUDES@ |
| 76 |
| 77 # Python installation |
| 78 |
| 79 PY_INCLUDE = -DHAVE_CONFIG_H @PYINCLUDE@ |
| 80 PY_LIB = @PYLIB@ |
| 81 |
| 82 # Tcl installation. Needed if rebuilding Python with tkinter. |
| 83 |
| 84 TCL_INCLUDE = @TCLINCLUDE@ |
| 85 TCL_LIB = @TCLLIB@ |
| 86 |
| 87 # Build libraries (needed for static builds) |
| 88 |
| 89 LIBM = @LIBM@ |
| 90 LIBC = @LIBC@ |
| 91 SYSLIBS = $(LIBM) $(LIBC) @LIBS@ |
| 92 |
| 93 # Build options (uncomment only one these) |
| 94 |
| 95 #TKINTER = $(TCL_LIB) -ltk -ltcl $(XLIB) |
| 96 BUILD_LIBS = $(LIBS) # Dynamic loading |
| 97 #BUILD_LIBS = $(PY_LIB) @PYLINK@ $(TKINTER) $(LIBS) $(SYSLIBS) |
| 98 |
| 99 # Compilation rules for non-SWIG components |
| 100 |
| 101 .SUFFIXES: .c .cxx .m |
| 102 |
| 103 .c.o: |
| 104 $(CC) $(CCSHARED) $(CFLAGS) $(INCLUDES) -c $< |
| 105 |
| 106 .cxx.o: |
| 107 $(CXX) $(CCSHARED) $(CXXFLAGS) $(INCLUDES) -c $< |
| 108 |
| 109 .m.o: |
| 110 $(OBJC) $(CCSHARED) $(CFLAGS) $(INCLUDES) -c $< |
| 111 |
| 112 |
| 113 # ---------------------------------------------------------------------- |
| 114 # Rules for building the extension |
| 115 # ---------------------------------------------------------------------- |
| 116 |
| 117 all: $(TARGET) |
| 118 |
| 119 # Convert the wrapper file into an object file |
| 120 |
| 121 $(WRAPOBJ) : $(WRAPFILE) |
| 122 $(SWIGCC) -c $(CCSHARED) $(CFLAGS) $(WRAPFILE) $(INCLUDES) $(PY_INCLUDE)
|
| 123 |
| 124 $(WRAPFILE) : $(INTERFACE) |
| 125 $(SWIG) $(SWIGOPT) -o $(WRAPFILE) $(SWIGLIB) $(INTERFACE) |
| 126 |
| 127 $(TARGET): $(WRAPOBJ) $(ALLOBJS) |
| 128 $(BUILD) $(WRAPOBJ) $(ALLOBJS) $(BUILD_LIBS) -o $(TARGET) |
| 129 |
| 130 clean: |
| 131 rm -f $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(WRAPOBJ) $(WRAPFILE) $(TARGET) |
| 132 |
| 133 |
| 134 |
| 135 |
OLD | NEW |