1 # Generated automatically from Makefile.in by configure.
2 # ---------------------------------------------------------------
6 # This file can be used to build various Perl5 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.
20 #----------------------------------------------------------------
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 = myperl # Use this target for static linking
33 exec_prefix = ${prefix}
37 OBJC = cc -Wno-import # -Wno-import needed for gcc
43 # SWIG = location of the SWIG executable
44 # SWIGOPT = SWIG compiler options
45 # SWIGCC = Compiler used to compile the wrapper file
47 SWIG = $(exec_prefix)/bin/swig
51 # SWIG Library files. Uncomment this to staticly rebuild Perl
52 #SWIGLIB = -static -lperlmain.i
54 # Rules for creating .o files from source.
57 CXXOBJS = $(CXXSRCS:.cxx=.o)
58 OBJCOBJS = $(OBJCSRCS:.m=.o)
59 ALLOBJS = $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(OBJS)
61 # Command that will be used to build the final extension.
64 # Uncomment the following if you are using dynamic loading
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).
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
74 # X11 installation (possibly needed if using Perl-Tk)
76 XLIB = -L/usr/openwin/lib -lX11
77 XINCLUDE = -I/usr/openwin/include
81 PERL_INCLUDE = -I/usr/local/lib/perl5/5.00503/sun4-solaris/CORE
82 PERL_LIB = -L/usr/local/lib/perl5/5.00503/sun4-solaris/CORE -lperl
83 PERL_FLAGS = -Dbool=char -Dexplicit=
85 # Tcl installation. If using Tk you might need this
87 TCL_INCLUDE = -I/usr/local/include
88 TCL_LIB = -L/usr/local/lib
90 # Build libraries (needed for static builds)
94 SYSLIBS = $(LIBM) $(LIBC) -lsocket -lnsl -ldl
96 # Build options (uncomment only one these)
98 #TK_LIB = $(TCL_LIB) -ltcl -ltk $(XLIB)
99 BUILD_LIBS = $(LIBS) # Dynamic loading
100 #BUILD_LIBS = $(PERL_LIB) $(TK_LIB) $(LIBS) $(SYSLIBS) # Static linking
102 # Compilation rules for non-SWIG components
104 .SUFFIXES: .c .cxx .m
107 $(CC) $(CCSHARED) $(CFLAGS) $(INCLUDE) -c $<
110 $(CXX) $(CCSHARED) $(CXXFLAGS) $(INCLUDE) -c $<
113 $(OBJC) $(CCSHARED) $(CFLAGS) $(INCLUDE) -c $<
116 # ----------------------------------------------------------------------
117 # Rules for building the extension
118 # ----------------------------------------------------------------------
122 # Convert the wrapper file into an object file
124 $(WRAPOBJ) : $(WRAPFILE)
125 $(SWIGCC) -c $(CCSHARED) $(CFLAGS) $(INCLUDE) $(PERL_INCLUDE) $(PERL_FLAGS) $(WRAPFILE)
127 $(WRAPFILE) : $(INTERFACE)
128 $(SWIG) $(SWIGOPT) -o $(WRAPFILE) $(SWIGLIB) $(INTERFACE)
130 $(TARGET): $(WRAPOBJ) $(ALLOBJS)
131 $(BUILD) $(WRAPOBJ) $(ALLOBJS) $(BUILD_LIBS) -o $(TARGET)
134 rm -f $(COBJS) $(CXXOBJS) $(OBJCOBJS) $(WRAPOBJ) $(WRAPFILE) $(TARGET)