Upstream version 1.3.40
[profile/ivi/swig.git] / Lib / tcl / Makefile.in
1 # ---------------------------------------------------------------
2 # SWIG Tcl/Tk Makefile
3
4 # This file can be used to build various Tcl 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. However, you
18 # may need to modify the Makefile to reflect your specific
19 # application.
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        = my_tclsh  # Use this target for static linking
31
32 prefix        = @prefix@
33 exec_prefix   = @exec_prefix@
34
35 CC            = @CC@
36 CXX           = @CXX@
37 OBJC          = @CC@ -Wno-import # -Wno-import needed for gcc 
38 CFLAGS        = 
39 INCLUDES      =
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       = -tcl # use -tcl8 for Tcl 8.0
49 SWIGCC        = $(CC) 
50
51 # SWIG Library files.  Uncomment one of these for rebuilding tclsh or wish
52 #SWIGLIB       = -ltclsh.i
53 #SWIGLIB       = -lwish.i
54
55 # Rules for creating .o files from source.
56
57 COBJS         = $(SRCS:.c=.o)
58 CXXOBJS       = $(CXXSRCS:.cxx=.o)
59 OBJCOBJS      = $(OBJCSRCS:.m=.o)
60 ALLOBJS       = $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(OBJS)
61
62 # Command that will be used to build the final extension.
63 BUILD         = $(SWIGCC)
64
65 # Uncomment the following if you are using dynamic loading
66 CCSHARED      = @CCSHARED@
67 BUILD         = @LDSHARED@
68
69 # Uncomment the following if you are using dynamic loading with C++ and
70 # need to provide additional link libraries (this is not always required).
71
72 #DLL_LIBS      = -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.7.2 \
73              -L/usr/local/lib -lg++ -lstdc++ -lgcc
74
75 # X11 installation (needed to rebuild Tk extensions)
76
77 XLIB          = @XLIBSW@
78 XINCLUDE      = @XINCLUDES@
79
80 # Tcl installation (where is Tcl/Tk located)
81
82 TCL_INCLUDE   = @TCLINCLUDE@
83 TCL_LIB       = @TCLLIB@
84
85 # Build libraries (needed for static builds)
86
87 LIBM          = @LIBM@
88 LIBC          = @LIBC@
89 SYSLIBS       = $(LIBM) $(LIBC) @LIBS@
90
91 # Build options (uncomment only one these)
92
93 BUILD_LIBS    = $(LIBS) # Dynamic loading
94 #BUILD_LIBS    = $(TCL_LIB) -ltcl $(LIBS) $(SYSLIBS) # tclsh  
95 #BUILD_LIBS    = $(TCL_LIB) -ltk -ltcl $(XLIB) $(LIBS) $(SYSLIBS) # wish
96
97 # Compilation rules for non-SWIG components
98
99 .SUFFIXES: .c .cxx .m
100
101 .c.o:
102         $(CC) $(CCSHARED) $(CFLAGS) $(INCLUDES) -c $<
103
104 .cxx.o:
105         $(CXX) $(CCSHARED) $(CXXFLAGS) $(INCLUDES) -c $<
106
107 .m.o:
108         $(OBJC) $(CCSHARED) $(CFLAGS) $(INCLUDES) -c $<
109
110
111 # ----------------------------------------------------------------------
112 # Rules for building the extension
113 # ----------------------------------------------------------------------
114
115 all: $(TARGET)
116
117 # Convert the wrapper file into an object file
118
119 $(WRAPOBJ) : $(WRAPFILE)
120         $(SWIGCC) -c $(CCSHARED) $(CFLAGS) $(WRAPFILE) $(INCLUDES) $(TCL_INCLUDE) 
121
122 $(WRAPFILE) : $(INTERFACE)
123         $(SWIG) $(SWIGOPT) -o $(WRAPFILE) $(SWIGLIB) $(INTERFACE)
124
125 $(TARGET): $(WRAPOBJ) $(ALLOBJS)
126         $(BUILD) $(WRAPOBJ) $(ALLOBJS) $(BUILD_LIBS) -o $(TARGET)
127
128 clean:
129         rm -f $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(WRAPOBJ) $(WRAPFILE) $(TARGET)
130
131
132
133