1 # Generated automatically from Makefile.in by configure.
2 # ---------------------------------------------------------------
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.
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. However, you
20 # may need to modify the Makefile to reflect your specific
22 #----------------------------------------------------------------
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
35 exec_prefix = ${prefix}
39 OBJC = cc -Wno-import # -Wno-import needed for gcc
45 # SWIG = location of the SWIG executable
46 # SWIGOPT = SWIG compiler options
47 # SWIGCC = Compiler used to compile the wrapper file
49 SWIG = $(exec_prefix)/bin/swig
50 SWIGOPT = -tcl # use -tcl8 for Tcl 8.0
53 # SWIG Library files. Uncomment one of these for rebuilding tclsh or wish
57 # Rules for creating .o files from source.
60 CXXOBJS = $(CXXSRCS:.cxx=.o)
61 OBJCOBJS = $(OBJCSRCS:.m=.o)
62 ALLOBJS = $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(OBJS)
64 # Command that will be used to build the final extension.
67 # Uncomment the following if you are using dynamic loading
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).
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
77 # X11 installation (needed to rebuild Tk extensions)
79 XLIB = -L/usr/openwin/lib -lX11
80 XINCLUDE = -I/usr/openwin/include
82 # Tcl installation (where is Tcl/Tk located)
84 TCL_INCLUDE = -I/usr/local/include
85 TCL_LIB = -L/usr/local/lib
87 # Build libraries (needed for static builds)
91 SYSLIBS = $(LIBM) $(LIBC) -lsocket -lnsl -ldl
93 # Build options (uncomment only one these)
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
99 # Compilation rules for non-SWIG components
101 .SUFFIXES: .c .cxx .m
104 $(CC) $(CCSHARED) $(CFLAGS) $(INCLUDE) -c $<
107 $(CXX) $(CCSHARED) $(CXXFLAGS) $(INCLUDE) -c $<
110 $(OBJC) $(CCSHARED) $(CFLAGS) $(INCLUDE) -c $<
113 # ----------------------------------------------------------------------
114 # Rules for building the extension
115 # ----------------------------------------------------------------------
119 # Convert the wrapper file into an object file
121 $(WRAPOBJ) : $(WRAPFILE)
122 $(SWIGCC) -c $(CCSHARED) $(CFLAGS) $(WRAPFILE) $(INCLUDE) $(TCL_INCLUDE)
124 $(WRAPFILE) : $(INTERFACE)
125 $(SWIG) $(SWIGOPT) -o $(WRAPFILE) $(SWIGLIB) $(INTERFACE)
127 $(TARGET): $(WRAPOBJ) $(ALLOBJS)
128 $(BUILD) $(WRAPOBJ) $(ALLOBJS) $(BUILD_LIBS) -o $(TARGET)
131 rm -f $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(WRAPOBJ) $(WRAPFILE) $(TARGET)