import source from 1.3.40
[external/swig.git] / Lib / perl5 / Makefile.in
1 # ---------------------------------------------------------------
2 # SWIG Perl5 Makefile
3
4 # This file can be used to build various Perl5 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.
18 #----------------------------------------------------------------
19
20 SRCS          = 
21 CXXSRCS       = 
22 OBJCSRCS      = 
23 OBJS          = 
24 INTERFACE     = 
25 WRAPFILE      = $(INTERFACE:.i=_wrap.c)
26 WRAPOBJ       = $(INTERFACE:.i=_wrap.o)
27 TARGET        = module@SO@ # Use this kind of target for dynamic loading
28 #TARGET        = myperl  # Use this target for static linking
29
30 prefix        = @prefix@
31 exec_prefix   = @exec_prefix@
32
33 CC            = @CC@
34 CXX           = @CXX@
35 OBJC          = @CC@ -Wno-import # -Wno-import needed for gcc 
36 CFLAGS        = 
37 INCLUDES      =
38 LIBS          =
39
40 # SWIG Options
41 #     SWIG      = location of the SWIG executable
42 #     SWIGOPT   = SWIG compiler options
43 #     SWIGCC    = Compiler used to compile the wrapper file
44
45 SWIG          = $(exec_prefix)/bin/swig 
46 SWIGOPT       = -perl5 
47 SWIGCC        = $(CC) 
48
49 # SWIG Library files.  Uncomment this to staticly rebuild Perl
50 #SWIGLIB       = -static -lperlmain.i
51
52 # Rules for creating .o files from source.
53
54 COBJS         = $(SRCS:.c=.o)
55 CXXOBJS       = $(CXXSRCS:.cxx=.o)
56 OBJCOBJS      = $(OBJCSRCS:.m=.o)
57 ALLOBJS       = $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(OBJS)
58
59 # Command that will be used to build the final extension.
60 BUILD         = $(SWIGCC)
61
62 # Uncomment the following if you are using dynamic loading
63 CCSHARED      = @CCSHARED@
64 BUILD         = @LDSHARED@
65
66 # Uncomment the following if you are using dynamic loading with C++ and
67 # need to provide additional link libraries (this is not always required).
68
69 #DLL_LIBS      = -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.7.2 \
70              -L/usr/local/lib -lg++ -lstdc++ -lgcc
71
72 # X11 installation (possibly needed if using Perl-Tk)
73
74 XLIB          = @XLIBSW@
75 XINCLUDE      = @XINCLUDES@
76
77 # Perl installation
78
79 PERL_INCLUDE  = -I@PERL5EXT@
80 PERL_LIB      = -L@PERL5EXT@ -lperl 
81 PERL_FLAGS    = -Dbool=char -Dexplicit=
82
83 # Tcl installation.  If using Tk you might need this
84
85 TCL_INCLUDE   = @TCLINCLUDE@
86 TCL_LIB       = @TCLLIB@
87
88 # Build libraries (needed for static builds)
89
90 LIBM          = @LIBM@
91 LIBC          = @LIBC@
92 SYSLIBS       = $(LIBM) $(LIBC) @LIBS@
93
94 # Build options (uncomment only one these)
95
96 #TK_LIB        = $(TCL_LIB) -ltcl -ltk $(XLIB)
97 BUILD_LIBS    = $(LIBS) # Dynamic loading
98 #BUILD_LIBS    = $(PERL_LIB) $(TK_LIB) $(LIBS) $(SYSLIBS)  # Static linking
99
100 # Compilation rules for non-SWIG components
101
102 .SUFFIXES: .c .cxx .m
103
104 .c.o:
105         $(CC) $(CCSHARED) $(CFLAGS) $(INCLUDES) -c $<
106
107 .cxx.o:
108         $(CXX) $(CCSHARED) $(CXXFLAGS) $(INCLUDES) -c $<
109
110 .m.o:
111         $(OBJC) $(CCSHARED) $(CFLAGS) $(INCLUDES) -c $<
112
113
114 # ----------------------------------------------------------------------
115 # Rules for building the extension
116 # ----------------------------------------------------------------------
117
118 all: $(TARGET)
119
120 # Convert the wrapper file into an object file
121
122 $(WRAPOBJ) : $(WRAPFILE)
123         $(SWIGCC) -c $(CCSHARED) $(CFLAGS) $(INCLUDES) $(PERL_INCLUDE) $(PERL_FLAGS) $(WRAPFILE)
124
125 $(WRAPFILE) : $(INTERFACE)
126         $(SWIG) $(SWIGOPT) -o $(WRAPFILE) $(SWIGLIB) $(INTERFACE)
127
128 $(TARGET): $(WRAPOBJ) $(ALLOBJS)
129         $(BUILD) $(WRAPOBJ) $(ALLOBJS) $(BUILD_LIBS) -o $(TARGET)
130
131 clean:
132         rm -f $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(WRAPOBJ) $(WRAPFILE) $(TARGET)
133
134
135
136
137
138