]> git.saurik.com Git - wxWidgets.git/blob - wxPython/wxSWIG/swig_lib/tcl/Makefile
Since I have made several changes to SWIG over the years to accomodate
[wxWidgets.git] / wxPython / wxSWIG / swig_lib / tcl / Makefile
1 # Generated automatically from Makefile.in by configure.
2 # ---------------------------------------------------------------
3 # $Header$
4 # SWIG Tcl/Tk Makefile
5 #
6 # This file can be used to build various Tcl 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. However, you
20 # may need to modify the Makefile to reflect your specific
21 # application.
22 #----------------------------------------------------------------
23
24 SRCS =
25 CXXSRCS =
26 OBJCSRCS =
27 OBJS =
28 INTERFACE =
29 WRAPFILE = $(INTERFACE:.i=_wrap.c)
30 WRAPOBJ = $(INTERFACE:.i=_wrap.o)
31 TARGET = module.so # Use this kind of target for dynamic loading
32 #TARGET = my_tclsh # Use this target for static linking
33
34 prefix = /usr/local
35 exec_prefix = ${prefix}
36
37 CC = cc
38 CXX = CC
39 OBJC = cc -Wno-import # -Wno-import needed for gcc
40 CFLAGS =
41 INCLUDE =
42 LIBS =
43
44 # SWIG Options
45 # SWIG = location of the SWIG executable
46 # SWIGOPT = SWIG compiler options
47 # SWIGCC = Compiler used to compile the wrapper file
48
49 SWIG = $(exec_prefix)/bin/swig
50 SWIGOPT = -tcl # use -tcl8 for Tcl 8.0
51 SWIGCC = $(CC)
52
53 # SWIG Library files. Uncomment one of these for rebuilding tclsh or wish
54 #SWIGLIB = -ltclsh.i
55 #SWIGLIB = -lwish.i
56
57 # Rules for creating .o files from source.
58
59 COBJS = $(SRCS:.c=.o)
60 CXXOBJS = $(CXXSRCS:.cxx=.o)
61 OBJCOBJS = $(OBJCSRCS:.m=.o)
62 ALLOBJS = $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(OBJS)
63
64 # Command that will be used to build the final extension.
65 BUILD = $(SWIGCC)
66
67 # Uncomment the following if you are using dynamic loading
68 CCSHARED =
69 BUILD = ld -G
70
71 # Uncomment the following if you are using dynamic loading with C++ and
72 # need to provide additional link libraries (this is not always required).
73
74 #DLL_LIBS = -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.7.2 \
75 -L/usr/local/lib -lg++ -lstdc++ -lgcc
76
77 # X11 installation (needed to rebuild Tk extensions)
78
79 XLIB = -L/usr/openwin/lib -lX11
80 XINCLUDE = -I/usr/openwin/include
81
82 # Tcl installation (where is Tcl/Tk located)
83
84 TCL_INCLUDE = -I/usr/local/include
85 TCL_LIB = -L/usr/local/lib
86
87 # Build libraries (needed for static builds)
88
89 LIBM = -lm
90 LIBC =
91 SYSLIBS = $(LIBM) $(LIBC) -lsocket -lnsl -ldl
92
93 # Build options (uncomment only one these)
94
95 BUILD_LIBS = $(LIBS) # Dynamic loading
96 #BUILD_LIBS = $(TCL_LIB) -ltcl $(LIBS) $(SYSLIBS) # tclsh
97 #BUILD_LIBS = $(TCL_LIB) -ltk -ltcl $(XLIB) $(LIBS) $(SYSLIBS) # wish
98
99 # Compilation rules for non-SWIG components
100
101 .SUFFIXES: .c .cxx .m
102
103 .c.o:
104 $(CC) $(CCSHARED) $(CFLAGS) $(INCLUDE) -c $<
105
106 .cxx.o:
107 $(CXX) $(CCSHARED) $(CXXFLAGS) $(INCLUDE) -c $<
108
109 .m.o:
110 $(OBJC) $(CCSHARED) $(CFLAGS) $(INCLUDE) -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) $(INCLUDE) $(TCL_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