]> git.saurik.com Git - wxWidgets.git/blame - 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
CommitLineData
c90f71dd
RD
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
22SRCS =
23CXXSRCS =
24OBJCSRCS =
25OBJS =
26INTERFACE =
27WRAPFILE = $(INTERFACE:.i=_wrap.c)
28WRAPOBJ = $(INTERFACE:.i=_wrap.o)
29TARGET = module.so # Use this kind of target for dynamic loading
30#TARGET = mypython # Use this target for static linking
31
32prefix = /usr/local
33exec_prefix = ${prefix}
34
35CC = cc
36CXX = CC
37OBJC = cc -Wno-import # -Wno-import needed for gcc
38CFLAGS =
39INCLUDE =
40LIBS =
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
47SWIG = $(exec_prefix)/bin/swig
48SWIGOPT = -python
49SWIGCC = $(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
56COBJS = $(SRCS:.c=.o)
57CXXOBJS = $(CXXSRCS:.cxx=.o)
58OBJCOBJS = $(OBJCSRCS:.m=.o)
59ALLOBJS = $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(OBJS)
60
61# Command that will be used to build the final extension.
62BUILD = $(SWIGCC)
63
64# Uncomment the following if you are using dynamic loading
65CCSHARED =
66BUILD = 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
76XLIB = -L/usr/openwin/lib -lX11
77XINCLUDE = -I/usr/openwin/include
78
79# Python installation
80
81PY_INCLUDE = -DHAVE_CONFIG_H -I/usr/local/include/python1.5 -I/usr/local/lib/python1.5/config
82PY_LIB = /usr/local/lib/python1.5/config
83
84# Tcl installation. Needed if rebuilding Python with tkinter.
85
86TCL_INCLUDE = -I/usr/local/include
87TCL_LIB = -L/usr/local/lib
88
89# Build libraries (needed for static builds)
90
91LIBM = -lm
92LIBC =
93SYSLIBS = $(LIBM) $(LIBC) -lsocket -lnsl -ldl
94
95# Build options (uncomment only one these)
96
97#TKINTER = $(TCL_LIB) -ltk -ltcl $(XLIB)
98BUILD_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
119all: $(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
132clean:
133 rm -f $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(WRAPOBJ) $(WRAPFILE) $(TARGET)
134
135
136
137