1 # Makefile for producing SWIG runtime libraries.
3 # The SWIG runtime library consists of the pointer-type checker
4 # and other support functions. Multi-file SWIG modules
5 # generally link with these libraries.
7 # By default, the installation processs will attempt to
8 # build shared libraries. If that doesn't work, a static
9 # library is built instead.
12 exec_prefix = @exec_prefix@
19 DYN_LIBS = libswigtcl8$(SO) libswigtcl$(SO) libswigpl$(SO) libswigpy$(SO)
20 STATIC_LIBS = libswigtcl8.a libswigtcl.a libswigpl.a libswigpy.a
21 LIBS = $(STATIC_LIBS) $(DYN_LIBS)
22 LIB_DIR = $(exec_prefix)/lib
24 INSTALL_DATA = ../install-sh -c -m 644
25 INSTALL_SHLB = ../install-sh -c -m 555
32 @echo "Installing runtime libraries"
33 @for i in $(STATIC_LIBS); \
36 echo "Installing $$i in $(LIB_DIR)/$$i"; \
37 $(INSTALL_DATA) $$i $(LIB_DIR)/$$i; \
40 @for i in $(DYN_LIBS); \
43 echo "Installing $$i in $(LIB_DIR)/$$i"; \
44 $(INSTALL_SHLB) $$i $(LIB_DIR)/$$i; \
50 rm -rf *.o *.a *$(SO) *.c *.swg *~ core
52 # ----------------------------------------------------------------------
54 # ----------------------------------------------------------------------
56 TCL_INCLUDE = @TCLINCLUDE@
62 ../swig -tcl -co -o libtcl.c -I../swig_lib swigtcl.swg
63 $(CC) $(CCSHARED) -c -DSWIG_GLOBAL libtcl.c
64 $(LDSHARED) libtcl.o -o libswigtcl$(SO)
69 ../swig -tcl -co -o libtcl.c -I../swig_lib swigtcl.swg
70 $(CC) -c -DSWIG_GLOBAL libtcl.c
71 $(AR) cr libswigtcl.a libtcl.o
76 ../swig -tcl -co -o libtcl8.c -I../swig_lib swigtcl8.swg
77 $(CC) $(CCSHARED) -c -DSWIG_GLOBAL $(TCL_INCLUDE) libtcl8.c
78 $(LDSHARED) libtcl8.o -o libswigtcl8$(SO)
81 ../swig -tcl -co -o libtcl8.c -I../swig_lib swigtcl8.swg
82 $(CC) -c -DSWIG_GLOBAL $(TCL_INCLUDE) libtcl8.c
83 $(AR) cr libswigtcl8.a libtcl8.o
85 # ----------------------------------------------------------------------
86 # Python run-time library
87 # ----------------------------------------------------------------------
89 PYTHON_INCLUDE= -DHAVE_CONFIG_H @PYINCLUDE@
95 ../swig -python -co -o libpy.c -I../swig_lib python.swg
96 $(CC) $(CCSHARED) -c -DSWIG_RUNTIME -DSWIG_GLOBAL $(PYTHON_INCLUDE) libpy.c
97 $(LDSHARED) libpy.o -o libswigpy$(SO)
102 ../swig -python -co -o libpy.c -I../swig_lib python.swg
103 $(CC) -c -DSWIG_RUNTIME -DSWIG_GLOBAL $(PYTHON_INCLUDE) libpy.c
104 $(AR) cr libswigpy.a libpy.o
106 # ----------------------------------------------------------------------
107 # Perl run-time library
108 # ----------------------------------------------------------------------
110 PERL5_INCLUDE= -I@PERL5EXT@
115 rm -f libperl.c libperl.swg
116 ../swig -perl5 -co -o libperl.swg -I../swig_lib perl5.swg
117 cat perlrun.h >> libperl.c
118 cat libperl.swg >> libperl.c
119 $(CC) $(CCSHARED) -c -Dexplicit= -Dbool=char -DSWIG_GLOBAL $(PERL5_INCLUDE) libperl.c
120 $(LDSHARED) libperl.o -o libswigpl$(SO)
125 rm -f libperl.c libperl.swg
126 ../swig -perl5 -co -o libperl.swg -I../swig_lib perl5.swg
127 cat perlrun.h >> libperl.c
128 cat libperl.swg >> libperl.c
129 $(CC) -c -Dexplicit= -Dbool=char -DSWIG_GLOBAL $(PERL5_INCLUDE) libperl.c
130 $(AR) cr libswigpl.a libperl.o