]> git.saurik.com Git - wxWidgets.git/blob - wxPython/wxSWIG/swig_lib/python/Makefile
Since I have made several changes to SWIG over the years to accomodate
[wxWidgets.git] / wxPython / wxSWIG / swig_lib / python / Makefile
1 # Generated automatically from Makefile.in by configure.
2 # ---------------------------------------------------------------
3 # $Header$
4 # SWIG Python Makefile
5 #
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.
10 #
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
17 #
18 # Many portions of this file were created by the SWIG configure
19 # script and should already reflect your machine.
20 #----------------------------------------------------------------
21
22 SRCS =
23 CXXSRCS =
24 OBJCSRCS =
25 OBJS =
26 INTERFACE =
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
31
32 prefix = /usr/local
33 exec_prefix = ${prefix}
34
35 CC = cc
36 CXX = CC
37 OBJC = cc -Wno-import # -Wno-import needed for gcc
38 CFLAGS =
39 INCLUDE =
40 LIBS =
41
42 # SWIG Options
43 # SWIG = location of the SWIG executable
44 # SWIGOPT = SWIG compiler options
45 # SWIGCC = Compiler used to compile the wrapper file
46
47 SWIG = $(exec_prefix)/bin/swig
48 SWIGOPT = -python
49 SWIGCC = $(CC)
50
51 # SWIG Library files. Uncomment if rebuilding the Python interpreter
52 #SWIGLIB = -lembed.i
53
54 # Rules for creating .o files from source.
55
56 COBJS = $(SRCS:.c=.o)
57 CXXOBJS = $(CXXSRCS:.cxx=.o)
58 OBJCOBJS = $(OBJCSRCS:.m=.o)
59 ALLOBJS = $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(OBJS)
60
61 # Command that will be used to build the final extension.
62 BUILD = $(SWIGCC)
63
64 # Uncomment the following if you are using dynamic loading
65 CCSHARED =
66 BUILD = ld -G
67
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).
70
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
73
74 # X11 installation (needed if rebuilding Python + tkinter)
75
76 XLIB = -L/usr/openwin/lib -lX11
77 XINCLUDE = -I/usr/openwin/include
78
79 # Python installation
80
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
83
84 # Tcl installation. Needed if rebuilding Python with tkinter.
85
86 TCL_INCLUDE = -I/usr/local/include
87 TCL_LIB = -L/usr/local/lib
88
89 # Build libraries (needed for static builds)
90
91 LIBM = -lm
92 LIBC =
93 SYSLIBS = $(LIBM) $(LIBC) -lsocket -lnsl -ldl
94
95 # Build options (uncomment only one these)
96
97 #TKINTER = $(TCL_LIB) -ltk -ltcl $(XLIB)
98 BUILD_LIBS = $(LIBS) # Dynamic loading
99 #BUILD_LIBS = $(PY_LIB) -lpython1.5 $(TKINTER) $(LIBS) $(SYSLIBS)
100
101 # Compilation rules for non-SWIG components
102
103 .SUFFIXES: .c .cxx .m
104
105 .c.o:
106 $(CC) $(CCSHARED) $(CFLAGS) $(INCLUDE) -c $<
107
108 .cxx.o:
109 $(CXX) $(CCSHARED) $(CXXFLAGS) $(INCLUDE) -c $<
110
111 .m.o:
112 $(OBJC) $(CCSHARED) $(CFLAGS) $(INCLUDE) -c $<
113
114
115 # ----------------------------------------------------------------------
116 # Rules for building the extension
117 # ----------------------------------------------------------------------
118
119 all: $(TARGET)
120
121 # Convert the wrapper file into an object file
122
123 $(WRAPOBJ) : $(WRAPFILE)
124 $(SWIGCC) -c $(CCSHARED) $(CFLAGS) $(WRAPFILE) $(INCLUDE) $(PY_INCLUDE)
125
126 $(WRAPFILE) : $(INTERFACE)
127 $(SWIG) $(SWIGOPT) -o $(WRAPFILE) $(SWIGLIB) $(INTERFACE)
128
129 $(TARGET): $(WRAPOBJ) $(ALLOBJS)
130 $(BUILD) $(WRAPOBJ) $(ALLOBJS) $(BUILD_LIBS) -o $(TARGET)
131
132 clean:
133 rm -f $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(WRAPOBJ) $(WRAPFILE) $(TARGET)
134
135
136
137