PageRenderTime 43ms CodeModel.GetById 9ms app.highlight 30ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/rel-1-3-24/SWIG/Examples/Makefile.in

#
Autoconf | 864 lines | 454 code | 168 blank | 242 comment | 25 complexity | 67ed8fb15c8ad48f345d1d61151b358e MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1# ------------------------------------------------------------
  2# SWIG Examples Makefile
  3#
  4# This file is used by the examples to build modules.  Assuming
  5# you ran configure, this file will probably work.  However,
  6# it's not perfect so you might need to do some hand tweaking.
  7#
  8# Other notes:
  9#
 10# 1.   Take a look at the prefixes below.   Since SWIG works with
 11#      multiple target languages, you may need to find out where
 12#      certain packages have been installed.   Set the prefixes
 13#      accordingly.
 14#
 15# 2.   To use this makefile, simply set SRCS, INTERFACE, INCLUDES, LIBS,
 16#      TARGET, and do a
 17#           $(MAKE) -f Makefile.template.in SRCS='$(SRCS)' \
 18#           INCLUDES='$(INCLUDES) LIBS='$(LIBS)' INTERFACE='$(INTERFACE)' \
 19#           TARGET='$(TARGET)' method
 20#
 21#      'method' describes what is being built.
 22#---------------------------------------------------------------
 23
 24TARGET     =
 25CC         = @CC@
 26CXX        = @CXX@
 27CFLAGS     = @PLATFLAGS@
 28prefix     = @prefix@
 29exec_prefix= @exec_prefix@
 30SRCS       =
 31INCLUDES   =
 32LIBS       =
 33INTERFACE  =
 34SWIGOPT    =
 35SWIG       = swig@release_suffix@
 36
 37LIBM       = @LIBM@
 38LIBC       = @LIBC@
 39LIBCRYPT   = @LIBCRYPT@
 40SYSLIBS    = $(LIBM) $(LIBC) $(LIBCRYPT)
 41LIBPREFIX  =
 42
 43# X11 options
 44
 45XLIB       = @XLIBSW@
 46XINCLUDE   = @XINCLUDES@
 47
 48IWRAP      = $(INTERFACE:.i=_wrap.i)
 49ISRCS      = $(IWRAP:.i=.c)
 50ICXXSRCS   = $(IWRAP:.i=.cxx)
 51IOBJS      = $(IWRAP:.i=.@OBJEXT@)
 52
 53##################################################################
 54# Dynamic loading for C++
 55# If you are going to be building dynamic loadable modules in C++,
 56# you may need to edit this line appropriately.
 57#
 58# This line works for g++, but I'm not sure what it might be
 59# for other C++ compilers
 60##################################################################
 61
 62CPP_DLLIBS = #-L/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.7.2 \
 63             -L/usr/local/lib -lg++ -lstdc++ -lgcc
 64
 65# Solaris workshop 5.0 
 66# CPP_DLLIBS = -L/opt/SUNWspro/lib -lCrun
 67
 68# Symbols used for using shared libraries
 69SO=		@SO@
 70LDSHARED=	@LDSHARED@
 71CCSHARED=	@CCSHARED@
 72CXXSHARED=      @CXXSHARED@
 73
 74# This is used for building shared libraries with a number of C++
 75# compilers.   If it doesn't work,  comment it out.
 76@TRYLINKINGWITHCXX@
 77
 78OBJS      = $(SRCS:.c=.@OBJEXT@) $(CXXSRCS:.cxx=.@OBJEXT@)
 79
 80##################################################################
 81#####                       Tcl/Tk                          ######
 82##################################################################
 83
 84# Set these to your local copy of Tcl/Tk.
 85
 86TCL_INCLUDE = @TCLINCLUDE@
 87TCL_LIB     = @TCLLIB@
 88TCL_OPTS    = @LIBS@
 89TK_OPTS     = -ltk -ltcl @LIBS@
 90
 91# Extra Tcl specific dynamic linking options
 92TCL_DLNK   = @TCLDYNAMICLINKING@
 93TCL_LDSHARED = @TCL_LDSHARED@
 94TCL_CXXSHARED = @TCL_CXXSHARED@
 95TCL_SO     = @TCL_SO@
 96
 97# -----------------------------------------------------------
 98# Build a new version of the tclsh shell
 99# -----------------------------------------------------------
100
101
102tclsh: $(SRCS)
103	$(SWIG) -tcl8 $(SWIGOPT) $(TCL_SWIGOPTS) -ltclsh.i $(INTERFACE)
104	$(CC) $(CFLAGS) $(SRCS) $(ISRCS) $(INCLUDES) $(TCL_INCLUDE) \
105	$(TCL_LIB)  $(TCL_OPTS) $(LIBS) $(SYSLIBS) -o $(TARGET)
106
107tclsh_cpp: $(SRCS)
108	$(SWIG) -tcl8 -c++ $(SWIGOPT) $(TCL_SWIGOPTS) -ltclsh.i $(INTERFACE)
109	$(CXX) $(CFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(TCL_INCLUDE) \
110	$(TCL_LIB) $(TCL_OPTS) $(LIBS) $(SYSLIBS) -o $(TARGET)
111
112# -----------------------------------------------------------
113# Build a new copy of wish
114# -----------------------------------------------------------
115
116wish: $(SRCS)
117	$(SWIG) -tcl8 $(SWIGOPT) $(TCL_SWIGOPTS) -lwish.i $(INTERFACE)
118	$(CC) $(CFLAGS) $(SRCS) $(ISRCS) $(INCLUDES) $(TCL_INCLUDE) \
119	$(XINCLUDE) $(TCL_LIB) $(TK_OPTS) $(XLIB) $(LIBS) $(SYSLIBS) -o $(TARGET)
120
121
122wish_cpp: $(SRCS)
123	$(SWIG) -tcl8 -c++ $(SWIGOPT) $(TCL_SWIGOPTS) -lwish.i $(INTERFACE)
124	$(CXX) $(CFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(TCL_INCLUDE) \
125	$(XINCLUDE) $(TCL_LIB) $(TK_OPTS) $(XLIB) $(LIBS) $(SYSLIBS) -o $(TARGET)
126
127# -----------------------------------------------------------
128# Build a Tcl dynamic loadable module (you might need to tweak this)
129# -----------------------------------------------------------
130
131tcl:  $(SRCS)
132	$(SWIG) -tcl8 $(SWIGOPT) $(TCL_SWIGOPTS) $(INTERFACE)
133	$(CC) -c $(CCSHARED) $(CFLAGS) $(SRCS) $(ISRCS) $(INCLUDES) $(TCL_INCLUDE)
134	$(TCL_LDSHARED) $(OBJS) $(IOBJS) $(TCL_DLNK) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(TCL_SO)
135
136# -----------------------------------------------------------
137# Build a Tcl7.5 dynamic loadable module for C++
138# -----------------------------------------------------------
139
140tcl_cpp: $(SRCS)
141	$(SWIG) -tcl8 -c++ $(SWIGOPT) $(TCL_SWIGOPTS) $(INTERFACE)
142	$(CXX) -c $(CCSHARED) $(CFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(TCL_INCLUDE)
143	$(TCL_CXXSHARED) $(OBJS) $(IOBJS) $(TCL_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(TCL_SO)
144
145# -----------------------------------------------------------------
146# Cleaning the Tcl examples
147# -----------------------------------------------------------------
148
149tcl_clean:
150	rm -f *.@OBJEXT@ *@SO@ *_wrap* *~ .~* core @EXTRA_CLEAN@ mytclsh@EXEEXT@ 
151
152##################################################################
153#####                       PERL 5                          ######
154##################################################################
155
156# You need to set this variable to the Perl5 directory containing the
157# files "perl.h", "EXTERN.h" and "XSUB.h".   With Perl5.003, it's
158# usually something like /usr/local/lib/perl5/arch-osname/5.003/CORE.
159
160PERL5_INCLUDE= @PERL5EXT@
161
162# Extra Perl specific dynamic linking options
163PERL5_DLNK   = @PERL5DYNAMICLINKING@
164PERL5_CCFLAGS = @PERL5CCFLAGS@
165
166# ----------------------------------------------------------------
167# Build a Perl5 dynamically loadable module (C)
168# ----------------------------------------------------------------
169
170perl5: $(SRCS)
171	$(SWIG) -perl5 $(SWIGOPT) $(INTERFACE)
172	$(CC) -c -Dbool=char $(CCSHARED) $(CFLAGS) $(SRCS) $(ISRCS) $(INCLUDES) $(PERL5_CCFLAGS) -I$(PERL5_INCLUDE)
173	$(LDSHARED) $(OBJS) $(IOBJS) $(PERL5_DLNK) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
174
175# ----------------------------------------------------------------
176# Build a Perl5 dynamically loadable module (C++)
177# ----------------------------------------------------------------
178
179perl5_cpp: $(SRCS)
180	$(SWIG) -perl5 -c++ $(SWIGOPT) $(INTERFACE)
181	$(CXX) -c $(CCSHARED) $(CFLAGS) -Dexplicit= $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(PERL5_CCFLAGS) -I$(PERL5_INCLUDE)
182	$(CXXSHARED) $(OBJS) $(IOBJS) $(PERL5_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
183
184# ----------------------------------------------------------------
185# Build a module from existing XS C source code.   (ie. from xsubpp).
186# ----------------------------------------------------------------
187perl5_xs: $(SRCS)
188	$(CC) -c $(CCSHARED) $(CFLAGS) $(SRCS) $(INCLUDES) -I$(PERL5_INCLUDE)
189	$(LDSHARED) $(OBJS) $(LIBS) -o $(TARGET)$(SO)
190
191# ----------------------------------------------------------------
192# Build a statically linked Perl5 executable
193# ----------------------------------------------------------------
194
195PERL5_LIB    = -L$(PERL5_INCLUDE) -l@PERL5LIB@ @LIBS@ $(SYSLIBS)
196
197perl5_static: $(SRCS)
198	$(SWIG) -perl5 -static -lperlmain.i $(SWIGOPT) $(INTERFACE)
199	$(CC) $(CFLAGS) -Dbool=char $(SRCS) $(ISRCS) $(INCLUDES) -I$(PERL5_INCLUDE) $(PERL5_LIB) $(LIBS) -o $(TARGET)
200
201perl5_static_cpp: $(SRCS)
202	$(SWIG) -perl5 -c++ -static -lperlmain.i $(SWIGOPT) $(INTERFACE)
203	$(CXX) $(CFLAGS) -Dexplicit= $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDES) -I$(PERL5_INCLUDE) $(PERL5_LIB) $(LIBS) -o $(TARGET)
204
205# -----------------------------------------------------------------
206# Cleaning the Perl5 examples
207# -----------------------------------------------------------------
208
209perl5_clean:
210	rm -f *.@OBJEXT@ *@SO@ *_wrap* *~ .~* core @EXTRA_CLEAN@ myperl@EXEEXT@ *.pm
211
212##################################################################
213#####                       PYTHON                          ######
214##################################################################
215
216# Make sure these locate your Python installation
217PYTHON_INCLUDE= -DHAVE_CONFIG_H @PYINCLUDE@
218PYTHON_LIB    = @PYLIB@
219
220# Extra Python specific dynamic linking options
221PYTHON_DLNK   = @PYTHONDYNAMICLINKING@
222PYTHON_SO     = @PYTHON_SO@
223
224# ----------------------------------------------------------------
225# Build a C dynamically loadable module
226# ----------------------------------------------------------------
227
228python: $(SRCS)
229	$(SWIG) -python $(SWIGOPT) $(INTERFACE)
230	$(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(SRCS) $(INCLUDES) $(PYTHON_INCLUDE)
231	$(LDSHARED) $(OBJS) $(IOBJS) $(PYTHON_DLNK) $(LIBS) -o $(LIBPREFIX)_$(TARGET)$(PYTHON_SO)
232
233# -----------------------------------------------------------------
234# Build a C++ dynamically loadable module
235# -----------------------------------------------------------------
236
237python_cpp: $(SRCS)
238	$(SWIG) -c++ -python $(SWIGOPT) $(INTERFACE)
239	$(CXX) -c $(CCSHARED) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) $(PYTHON_INCLUDE)
240	$(CXXSHARED) $(OBJS) $(IOBJS) $(PYTHON_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)_$(TARGET)$(PYTHON_SO)
241
242# -----------------------------------------------------------------
243# Build statically linked Python interpreter
244#
245# These should only be used in conjunction with the %include embed.i
246# library file
247# -----------------------------------------------------------------
248
249#TKINTER = -L/usr/X11R6.3/lib -L/usr/local/compat/lib -ltk4.0 -ltcl7.4 -lX11
250TKINTER =
251PYTHON_LIBOPTS = @PYLINK@ @LIBS@ $(TKINTER) $(SYSLIBS)
252
253python_static: $(SRCS)
254	$(SWIG) -python -lembed.i $(SWIGOPT) $(INTERFACE)
255	$(CC) $(CFLAGS) @LINKFORSHARED@ $(ISRCS) $(SRCS) $(INCLUDES) \
256	$(PYTHON_INCLUDE) $(LIBS) -L$(PYTHON_LIB) $(PYTHON_LIBOPTS) -o $(TARGET)
257
258python_static_cpp: $(SRCS)
259	$(SWIG) -c++ -python -lembed.i $(SWIGOPT) $(INTERFACE)
260	$(CXX) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) \
261	$(PYTHON_INCLUDE) $(LIBS)  -L$(PYTHON_LIB) $(PYTHON_LIBOPTS) -o $(TARGET)
262
263# -----------------------------------------------------------------
264# Cleaning the python examples
265# -----------------------------------------------------------------
266
267python_clean:
268	rm -f *.@OBJEXT@ *@SO@ *_wrap* *~ .~* core @EXTRA_CLEAN@ mypython@EXEEXT@ *.pyc
269
270##################################################################
271#####                       GUILE                           ######
272##################################################################
273
274# Make sure these locate your Guile installation
275GUILE_INCLUDE = @GUILEINCLUDE@
276GUILE_LIB     = @GUILELIB@
277GUILE_SO      = @GUILE_SO@
278GUILE_LIBPREFIX = lib
279
280#------------------------------------------------------------------
281# Build a dynamically loaded module with passive linkage and the scm interface
282#------------------------------------------------------------------
283guile: $(SRCS)
284	$(SWIG) -guile -scm -Linkage passive $(SWIGOPT) $(INTERFACE)
285	$(CC) -c $(CCSHARED) $(CFLAGS) $(INCLUDES) $(GUILE_INCLUDE) $(ISRCS) $(SRCS)
286	$(LDSHARED) $(OBJS) $(IOBJS) $(LIBS) -o $(GUILE_LIBPREFIX)$(TARGET)$(GUILE_SO)
287
288guile_cpp: $(SRCS)
289	$(SWIG) -c++ -guile -scm -Linkage passive $(SWIGOPT) $(INTERFACE)
290	$(CXX) -c $(CCSHARED) $(CFLAGS) $(INCLUDES) $(GUILE_INCLUDE) $(ICXXSRCS) $(SRCS) $(CXXSRCS)
291	$(CXXSHARED) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(GUILE_LIBPREFIX)$(TARGET)$(GUILE_SO)
292
293#------------------------------------------------------------------
294# Build a dynamically loaded module with passive linkage and the gh interface
295#------------------------------------------------------------------
296guile_gh: $(SRCS)
297	$(SWIG) -guile -gh -Linkage passive $(SWIGOPT) $(INTERFACE)
298	$(CC) -c $(CCSHARED) $(CFLAGS) $(INCLUDES) $(GUILE_INCLUDE) $(ISRCS) $(SRCS)
299	$(LDSHARED) $(OBJS) $(IOBJS) $(LIBS) -o $(GUILE_LIBPREFIX)$(TARGET)$(GUILE_SO)
300
301guile_gh_cpp: $(SRCS)
302	$(SWIG) -c++ -guile -gh -Linkage passive $(SWIGOPT) $(INTERFACE)
303	$(CXX) -c $(CCSHARED) $(CFLAGS) $(INCLUDES) $(GUILE_INCLUDE) $(ICXXSRCS) $(SRCS) $(CXXSRCS)
304	$(CXXSHARED) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(GUILE_LIBPREFIX)$(TARGET)$(GUILE_SO)
305
306# -----------------------------------------------------------------
307# Build a dynamically loadable module with passive linkage
308# -----------------------------------------------------------------
309
310guile_passive: $(SRCS)
311	$(SWIG) -guile -Linkage passive $(SWIGOPT) $(INTERFACE)
312	$(CC) -c $(CCSHARED) $(CFLAGS) $(INCLUDES) $(GUILE_INCLUDE) $(ISRCS) $(SRCS)
313	$(LDSHARED) $(OBJS) $(IOBJS) $(LIBS) -o $(GUILE_LIBPREFIX)$(TARGET)$(GUILE_SO)
314
315guile_passive_cpp: $(SRCS)
316	$(SWIG) -c++ -guile -Linkage passive $(SWIGOPT) $(INTERFACE)
317	$(CXX) -c $(CCSHARED) $(CFLAGS) $(INCLUDES) $(GUILE_INCLUDE) $(ICXXSRCS) $(SRCS) $(CXXSRCS)
318	$(CXXSHARED) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(GUILE_LIBPREFIX)$(TARGET)$(GUILE_SO)
319
320# -----------------------------------------------------------------
321# Build statically linked Guile interpreter
322# -----------------------------------------------------------------
323
324GUILE_LIBOPTS = @GUILELINK@ @LIBS@ $(SYSLIBS)
325
326guile_static: $(SRCS)
327	$(SWIG) -guile -lguilemain.i -Linkage ltdlmod $(SWIGOPT) $(INTERFACE)
328	$(CC) $(CFLAGS) $(ISRCS) $(SRCS) $(INCLUDES) \
329	  -DSWIGINIT="SCM scm_init_$(TARGET)_module(void); scm_init_$(TARGET)_module();" \
330	  $(GUILE_INCLUDE) $(LIBS) -L$(GUILE_LIB) $(GUILE_LIBOPTS) -o $(TARGET)-guile
331
332guile_static_cpp: $(SRCS)
333	$(SWIG) -c++ -guile -lguilemain.i -Linkage ltdlmod $(SWIGOPT) $(INTERFACE)
334	$(CXX) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) \
335	  -DSWIGINIT="SCM scm_init_$(TARGET)_module(void); scm_init_$(TARGET)_module();" \
336	  $(GUILE_INCLUDE) $(LIBS) -L$(GUILE_LIB) $(GUILE_LIBOPTS) -o $(TARGET)-guile
337
338guile_simple: $(SRCS)
339	$(SWIG) -guile -lguilemain.i -Linkage simple $(SWIGOPT) $(INTERFACE)
340	$(CC) $(CFLAGS) $(ISRCS) $(SRCS) $(INCLUDES) \
341	  $(GUILE_INCLUDE) $(LIBS) -L$(GUILE_LIB) $(GUILE_LIBOPTS) -o $(TARGET)-guile
342
343guile_simple_cpp: $(SRCS)
344	$(SWIG) -c++ -guile -lguilemain.i -Linkage simple $(SWIGOPT) $(INTERFACE)
345	$(CXX) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) \
346	  $(GUILE_INCLUDE) $(LIBS) -L$(GUILE_LIB) $(GUILE_LIBOPTS) -o $(TARGET)-guile
347
348# -----------------------------------------------------------------
349# Cleaning the Guile examples
350# -----------------------------------------------------------------
351
352guile_clean:
353	rm -f *.@OBJEXT@ *@SO@ *.$(GUILE_SO) *_wrap* *~ .~* core @EXTRA_CLEAN@ my-guile@EXEEXT@ $(TARGET)@EXEEXT@
354
355##################################################################
356#####                       JAVA                            ######
357##################################################################
358
359# You need to set this variable to the java directories containing the
360# files "jni.h" and "md.h"
361# usually something like /usr/java/include and /usr/java/include/<arch-osname>.
362JAVA_INCLUDE= @JAVAINC@
363
364# Extra Java specific dynamic linking options
365JAVA_DLNK  = @JAVADYNAMICLINKING@
366JAVA_LIBPREFIX = @JAVALIBRARYPREFIX@
367JAVASO =@JAVASO@
368JAVALDSHARED = @JAVALDSHARED@
369JAVACXXSHARED = @JAVACXXSHARED@
370JAVACFLAGS = @JAVACFLAGS@
371
372# ----------------------------------------------------------------
373# Build a java dynamically loadable module (C)
374# ----------------------------------------------------------------
375
376java: $(SRCS)
377	$(SWIG) -java $(SWIGOPT) $(INTERFACE)
378	$(CC) -c $(CCSHARED) $(CFLAGS) $(JAVACFLAGS) $(SRCS) $(ISRCS) $(INCLUDES) $(JAVA_INCLUDE)
379	$(JAVALDSHARED) $(OBJS) $(IOBJS) $(JAVA_DLNK) $(LIBS) -o $(JAVA_LIBPREFIX)$(TARGET)$(JAVASO)
380
381# ----------------------------------------------------------------
382# Build a java dynamically loadable module (C++)
383# ----------------------------------------------------------------
384
385java_cpp: $(SRCS)
386	$(SWIG) -java -c++ $(SWIGOPT) $(INTERFACE)
387	$(CXX) -c $(CCSHARED) $(CFLAGS) $(JAVACFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(JAVA_INCLUDE)
388	$(JAVACXXSHARED) $(OBJS) $(IOBJS) $(JAVA_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(JAVA_LIBPREFIX)$(TARGET)$(JAVASO)
389
390# -----------------------------------------------------------------
391# Cleaning the java examples
392# -----------------------------------------------------------------
393
394java_clean:
395	rm -f *.@OBJEXT@ *@JAVASO@ *_wrap* *~ .~* core @EXTRA_CLEAN@ *.class `find . -name \*.java | grep -v main.java`
396
397##################################################################
398#####                      MODULA3                          ######
399##################################################################
400
401MODULA3_INCLUDE= @MODULA3INC@
402
403# ----------------------------------------------------------------
404# Build a modula3 dynamically loadable module (C)
405# ----------------------------------------------------------------
406
407modula3: $(SRCS)
408	$(SWIG) -modula3 $(SWIGOPT) $(INTERFACE)
409#	$(CC) -c $(CCSHARED) $(CFLAGS) $(SRCS) $(ISRCS) $(INCLUDES) \
410#       $(OBJS) $(IOBJS) $(LIBS)
411
412modula3_cpp: $(SRCS)
413	$(SWIG) -modula3 -c++ $(SWIGOPT) $(INTERFACE)
414
415# -----------------------------------------------------------------
416# Cleaning the modula3 examples
417# -----------------------------------------------------------------
418
419modula3_clean:
420	rm -f *_wrap* *.i3 *.m3
421
422##################################################################
423#####                       MZSCHEME                        ######
424##################################################################
425
426MZC = test -n "@MZC@" && @MZC@
427MZDYNOBJ = @MZDYNOBJ@
428MZSCHEME_SO = @MZSCHEME_SO@
429
430# ----------------------------------------------------------------
431# Build a C/C++ dynamically loadable module
432# ----------------------------------------------------------------
433
434mzscheme: $(SRCS)
435	$(SWIG) -mzscheme $(SWIGOPT) $(INTERFACE)
436	$(MZC) ++ccf "$(INCLUDES)" --cc $(ISRCS) $(SRCS)
437	$(MZC) --ld $(TARGET)$(MZSCHEME_SO) $(OBJS) $(IOBJS)
438
439mzscheme_cpp: $(SRCS)
440	$(SWIG) -mzscheme -c++ $(SWIGOPT) $(INTERFACE)
441	$(MZC) ++ccf "$(INCLUDES)" --cc $(ICXXSRCS) $(SRCS) $(CXXSRCS)
442	$(CXXSHARED) -o $(LIBPREFIX)$(TARGET)$(MZSCHEME_SO) $(OBJS) $(IOBJS) $(MZDYNOBJ) $(CPP_DLLIBS) 
443
444# -----------------------------------------------------------------
445# Cleaning the mzscheme examples
446# -----------------------------------------------------------------
447
448mzscheme_clean:
449	rm -f *.@OBJEXT@ *@SO@ *_wrap* *~ .~* core @EXTRA_CLEAN@
450
451##################################################################
452#####                          Ocaml                         #####
453##################################################################
454
455OCC=@OCAMLC@
456OCAMLDLGEN=@OCAMLDLGEN@
457OCAMLFIND=@OCAMLFIND@
458OCAMLMKTOP=@OCAMLMKTOP@ $(SWIGWHERE)
459NOLINK ?= false
460OCAMLPP= -pp "camlp4o ./swigp4.cmo"
461OCAMLCORE=\
462	rm -rf swig.mli swig.ml swigp4.ml && \
463	$(SWIG) -ocaml -co swig.mli 2>/dev/null &&  \
464	$(SWIG) -ocaml -co swig.ml 2>/dev/null &&  \
465	$(SWIG) -ocaml -co swigp4.ml 2>/dev/null &&  \
466	$(OCC) -c swig.mli &&  \
467	$(OCC) -c swig.ml &&  \
468	$(OCC) -I `camlp4 -where` -pp "camlp4o pa_extend.cmo q_MLast.cmo" \
469		-c swigp4.ml
470
471ocaml_static: $(SRCS)
472	$(OCAMLCORE)
473	$(SWIG) -ocaml $(SWIGOPT) $(INTERFACE)
474	$(OCC) -g -c -ccopt -g -ccopt "$(INCLUDES)" $(ISRCS) $(SRCS)
475	$(OCC) -g -c $(INTERFACE:%.i=%.mli)
476	$(OCC) -g -c $(INTERFACE:%.i=%.ml)
477	test -z "$(PROGFILE)" || test -f "$(PROGFILE)" && \
478		$(OCC) $(OCAMLPP) -c $(PROGFILE)
479	$(NOLINK) || $(OCC) -g -ccopt -g -cclib -g -custom -o $(TARGET) \
480		swig.cmo \
481		$(INTERFACE:%.i=%.cmo) \
482		$(PROGFILE:%.ml=%.cmo) \
483		$(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS) -cclib "$(LIBS)"
484
485ocaml_dynamic: $(SRCS)
486	$(OCAMLCORE)
487	$(SWIG) -ocaml $(SWIGOPT) $(INTERFACE)
488	$(OCC) -g -c -ccopt -g -ccopt "$(INCLUDES)" $(ISRCS) $(SRCS)
489	$(CXXSHARED) $(CCSHARED) $(CFLAGS) -o $(INTERFACE:%.i=%@SO@) \
490		$(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS) $(LIBS)
491	$(OCAMLDLGEN) $(INTERFACE:%.i=%.ml) $(INTERFACE:%.i=%@SO@) > \
492		$(INTERFACE:%.i=%_dynamic.ml)
493	mv $(INTERFACE:%.i=%_dynamic.ml) $(INTERFACE:%.i=%.ml)
494	rm $(INTERFACE:%.i=%.mli)
495	$(OCAMLFIND) $(OCC) -g -c -package dl $(INTERFACE:%.i=%.ml)
496	test -z "$(PROGFILE)" || test -f "$(PROGFILE)" && \
497		$(OCC) $(OCAMLPP) -c $(PROGFILE)
498	$(NOLINK) || $(OCAMLFIND) \
499		$(OCC) -g -ccopt -g -cclib -g -custom -o $(TARGET) \
500		swig.cmo \
501		-package dl -linkpkg \
502		$(INTERFACE:%.i=%.cmo) $(PROGFILE:%.ml=%.cmo)
503
504ocaml_static_toplevel: $(SRCS)
505	$(OCAMLCORE)
506	$(SWIG) -ocaml $(SWIGOPT) $(INTERFACE)
507	$(OCC) -g -c -ccopt -g -ccopt "$(INCLUDES)" $(ISRCS) $(SRCS)
508	$(OCC) -g -c $(INTERFACE:%.i=%.mli)
509	$(OCC) -g -c $(INTERFACE:%.i=%.ml)
510	test -z "$(PROGFILE)" || test -f "$(PROGFILE)" && \
511		$(OCC) $(OCAMLPP) -c $(PROGFILE)
512	$(NOLINK) || $(OCAMLMKTOP) \
513		swig.cmo \
514		-I `camlp4 -where` camlp4o.cma swigp4.cmo \
515		-g -ccopt -g -cclib -g -custom -o $(TARGET)_top \
516		$(INTERFACE:%.i=%.cmo) \
517		$(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS) -cclib "$(LIBS)"
518
519ocaml_static_cpp: $(SRCS)
520	$(OCAMLCORE)
521	$(SWIG) -ocaml -c++ $(SWIGOPT) $(INTERFACE)
522	cp $(ICXXSRCS) $(ICXXSRCS:%.cxx=%.c)
523	$(OCC) -cc '$(CXX)' -g -c -ccopt -g -ccopt "-xc++ $(INCLUDES)" \
524		$(ICXXSRCS:%.cxx=%.c) $(SRCS) $(CXXSRCS)
525	$(OCC) -g -c $(INTERFACE:%.i=%.mli)
526	$(OCC) -g -c $(INTERFACE:%.i=%.ml)
527	test -z "$(PROGFILE)" || test -f "$(PROGFILE)" && \
528		$(OCC) $(OCAMLPP) -c $(PROGFILE)
529	$(NOLINK) || $(OCC) -g -ccopt -g -cclib -g -custom -o $(TARGET) \
530		swig.cmo \
531		$(INTERFACE:%.i=%.cmo) \
532		$(PROGFILE:%.ml=%.cmo) \
533		$(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS) \
534		-cclib "$(LIBS)" -cc '$(CXX)' 
535
536ocaml_static_cpp_toplevel: $(SRCS)
537	$(OCAMLCORE)
538	$(SWIG) -ocaml -c++ $(SWIGOPT) $(INTERFACE)
539	cp $(ICXXSRCS) $(ICXXSRCS:%.cxx=%.c)
540	$(OCC) -cc '$(CXX)' -g -c -ccopt -g -ccopt "-xc++ $(INCLUDES)" \
541		$(ICXXSRCS:%.cxx=%.c) $(SRCS) $(CXXSRCS)
542	$(OCC) -g -c $(INTERFACE:%.i=%.mli)
543	$(OCC) -g -c $(INTERFACE:%.i=%.ml)
544	test -z "$(PROGFILE)" || test -f "$(PROGFILE)" && \
545		$(OCC) $(OCAMLPP) -c $(PROGFILE)
546	$(NOLINK) || $(OCAMLMKTOP) \
547		swig.cmo \
548		-I `camlp4 -where` camlp4o.cma swigp4.cmo \
549		-g -ccopt -g -cclib -g -custom -o $(TARGET)_top \
550		$(INTERFACE:%.i=%.cmo) \
551		$(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS) \
552		-cclib "$(LIBS)" -cc '$(CXX)' 
553
554ocaml_dynamic_cpp: $(SRCS)
555	$(OCAMLCORE)
556	$(SWIG) -ocaml -c++ $(SWIGOPT) $(INTERFACE)
557	cp $(ICXXSRCS) $(ICXXSRCS:%.cxx=%.c)
558	$(OCC) -cc '$(CXX)' -g -c -ccopt -g -ccopt "-xc++ $(INCLUDES)" \
559		$(ICXXSRCS:%.cxx=%.c) $(SRCS) $(CXXSRCS) -ccopt -fPIC
560	$(CXXSHARED) $(CXXFLAGS) -o $(INTERFACE:%.i=%@SO@) \
561		$(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS) \
562		$(CPP_DLLIBS) $(LIBS)
563	$(OCAMLDLGEN) $(INTERFACE:%.i=%.ml) $(INTERFACE:%.i=%@SO@) > \
564		$(INTERFACE:%.i=%_dynamic.ml)
565	mv $(INTERFACE:%.i=%_dynamic.ml) $(INTERFACE:%.i=%.ml)
566	rm $(INTERFACE:%.i=%.mli)
567	$(OCAMLFIND) $(OCC) -g -c -package dl $(INTERFACE:%.i=%.ml)
568	test -z "$(PROGFILE)" || test -f "$(PROGFILE)" && \
569		$(OCC) $(OCAMLPP) -c $(PROGFILE)
570	$(NOLINK) || $(OCAMLFIND) \
571		swig.cmo \
572		$(OCC) -cclib -export-dynamic -g -ccopt -g -cclib -g -custom \
573		-o $(TARGET) \
574		-package dl -linkpkg \
575		$(INTERFACE:%.i=%.cmo) $(PROGFILE:%.ml=%.cmo) -cc '$(CXX)'
576
577ocaml_clean:
578	rm -f *.@OBJEXT@ *@SO@ *_wrap* *~ .~* core @EXTRA_CLEAN@ *.cmo *.cmi $(MLFILE) $(MLFILE)i swig.mli swig.cmi swig.ml swig.cmo swigp4.ml swigp4.cmo
579
580##################################################################
581#####                       RUBY                            ######
582##################################################################
583
584# Make sure these locate your Ruby installation
585RUBY_CFLAGS= @RUBYCCDLFLAGS@ -DHAVE_CONFIG_H
586RUBY_INCLUDE= @RUBYINCLUDE@
587RUBY_LIB     = @RUBYLIB@
588RUBY_DLNK = @RUBYDYNAMICLINKING@
589
590# ----------------------------------------------------------------
591# Build a C dynamically loadable module
592# ----------------------------------------------------------------
593
594ruby: $(SRCS)
595	$(SWIG) -ruby $(SWIGOPT) $(INTERFACE)
596	$(CC) -c $(CCSHARED) $(CFLAGS) $(RUBY_CFLAGS) $(ISRCS) $(SRCS) $(INCLUDES) $(RUBY_INCLUDE)
597	$(LDSHARED) $(OBJS) $(IOBJS) $(RUBY_DLNK) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
598
599# -----------------------------------------------------------------
600# Build a C++ dynamically loadable module
601# -----------------------------------------------------------------
602
603ruby_cpp: $(SRCS)
604	$(SWIG) -c++ -ruby $(SWIGOPT) $(INTERFACE)
605	$(CXX) -c $(CCSHARED) $(CFLAGS) $(RUBY_CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) $(RUBY_INCLUDE)
606	$(CXXSHARED) $(OBJS) $(IOBJS) $(RUBY_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
607
608# -----------------------------------------------------------------
609# Build statically linked Ruby interpreter
610#
611# These should only be used in conjunction with the %include embed.i
612# library file
613# -----------------------------------------------------------------
614
615RUBY_LIBOPTS = @RUBYLINK@ @LIBS@ $(SYSLIBS)
616
617ruby_static: $(SRCS)
618	$(SWIG) -ruby -lembed.i $(SWIGOPT) $(INTERFACE)
619	$(CC) $(CFLAGS) $(RUBY_CFLAGS) @LINKFORSHARED@ $(ISRCS) $(SRCS) $(INCLUDES) \
620	$(RUBY_INCLUDE) $(LIBS) -L$(RUBY_LIB) $(RUBY_LIBOPTS) -o $(TARGET)
621
622ruby_cpp_static: $(SRCS)
623	$(SWIG) -c++ -ruby -lembed.i $(SWIGOPT) $(INTERFACE)
624	$(CXX) $(CFLAGS) $(RUBY_CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) \
625	$(RUBY_INCLUDE) $(LIBS)  -L$(RUBY_LIB) $(RUBY_LIBOPTS) -o $(TARGET)
626
627
628# -----------------------------------------------------------------
629# Cleaning the Ruby examples
630# -----------------------------------------------------------------
631
632ruby_clean:
633	rm -f *.@OBJEXT@ *@SO@ *_wrap* *~ .~* core @EXTRA_CLEAN@ myruby@EXEEXT@ *.pm
634
635##################################################################
636#####                       PHP                             ######
637##################################################################
638
639# -------------------------------------------------------------------
640# Build a PHP4 dynamically loadable module (C)
641# -------------------------------------------------------------------
642
643PHP4_INCLUDE = @PHP4INC@
644PHP4_SO      = @PHP4_SO@
645
646php4: $(SRCS)
647	$(SWIG) -php4 -cppext cxx $(SWIGOPT) $(INTERFACE)
648	$(CC) -c $(CCSHARED) $(CFLAGS) $(SRCS) $(ISRCS) $(INCLUDES) $(PHP4_INCLUDE)
649	$(LDSHARED) $(OBJS) $(IOBJS) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(PHP4_SO)
650
651# --------------------------------------------------------------------
652# Build a PHP4 dynamically loadable module (C++)
653# --------------------------------------------------------------------
654
655php4_cpp: $(SRCS)
656	$(SWIG) -php4 -cppext cxx -c++ $(SWIGOPT) $(INTERFACE)
657	$(CXX) -c $(CCSHARED) $(CFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(PHP4_INCLUDE)
658	$(CXXSHARED) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(PHP4_SO)
659
660# -----------------------------------------------------------------
661# Running a PHP4 example
662# -----------------------------------------------------------------
663
664PHP4=@PHP4@
665
666php4_run: 
667	env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(PHP4) -q -d extension_dir=. $(SCRIPT)
668
669# -----------------------------------------------------------------
670# Cleaning the PHP4 examples
671# -----------------------------------------------------------------
672
673php4_clean:
674	rm -f *.@OBJEXT@ *$(SO) *_wrap* *~ .~* core @EXTRA_CLEAN@ *.php
675
676##################################################################
677#####                       Pike                            ######
678##################################################################
679
680# Make sure these locate your Pike installation
681PIKE_CFLAGS  = @PIKECCDLFLAGS@ -DHAVE_CONFIG_H
682PIKE_INCLUDE = @PIKEINCLUDE@
683PIKE_LIB     = @PIKELIB@
684PIKE_DLNK    = @PIKEDYNAMICLINKING@
685
686# ----------------------------------------------------------------
687# Build a C dynamically loadable module
688# ----------------------------------------------------------------
689
690pike: $(SRCS)
691	$(SWIG) -pike $(SWIGOPT) $(INTERFACE)
692	$(CC) -c $(CCSHARED) $(CFLAGS) $(PIKE_CFLAGS) $(ISRCS) $(SRCS) $(INCLUDES) $(PIKE_INCLUDE)
693	$(LDSHARED) $(OBJS) $(IOBJS) $(PIKE_DLNK) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
694
695# -----------------------------------------------------------------
696# Build a C++ dynamically loadable module
697# -----------------------------------------------------------------
698
699pike_cpp: $(SRCS)
700	$(SWIG) -c++ -pike $(SWIGOPT) $(INTERFACE)
701	$(CXX) -c $(CCSHARED) $(CFLAGS) $(PIKE_CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) $(PIKE_INCLUDE)
702	$(CXXSHARED) $(OBJS) $(IOBJS) $(PIKE_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
703
704# -----------------------------------------------------------------
705# Build statically linked Pike interpreter
706#
707# These should only be used in conjunction with the %include embed.i
708# library file
709# -----------------------------------------------------------------
710
711PIKE_LIBOPTS = @PIKELINK@ @LIBS@ $(SYSLIBS)
712
713pike_static: $(SRCS)
714	$(SWIG) -pike -lembed.i $(SWIGOPT) $(INTERFACE)
715	$(CC) $(CFLAGS) $(PIKE_CFLAGS) @LINKFORSHARED@ $(ISRCS) $(SRCS) $(INCLUDES) \
716	$(PIKE_INCLUDE) $(LIBS) -L$(PIKE_LIB) $(PIKE_LIBOPTS) -o $(TARGET)
717
718pike_cpp_static: $(SRCS)
719	$(SWIG) -c++ -pike -lembed.i $(SWIGOPT) $(INTERFACE)
720	$(CXX) $(CFLAGS) $(PIKE_CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) \
721	$(PIKE_INCLUDE) $(LIBS)  -L$(PIKE_LIB) $(PIKE_LIBOPTS) -o $(TARGET)
722
723# -----------------------------------------------------------------
724# Cleaning the Pike examples
725# -----------------------------------------------------------------
726
727pike_clean:
728	rm -f *.@OBJEXT@ *$(SO) *_wrap* *~ .~* core @EXTRA_CLEAN@ mypike@EXEEXT@ 
729
730
731##################################################################
732#####                      Chicken                          ######
733##################################################################
734
735CHICKEN = @CHICKEN@
736CHICKEN_CSC = @CHICKEN_CSC@
737CHICKEN_LIBOPTS = @CHICKENLIB@  $(SYSLIBS)
738CHICKEN_SHAREDLIBOPTS = @CHICKENSHAREDLIB@  $(SYSLIBS)
739CHICKEN_CFLAGS = @CHICKENOPTS@
740CHICKENOPTS = -quiet
741CHICKEN_MAIN =
742
743# SWIG produces $(ISRCS) (the C wrapper file) 
744# and $(CHICKEN_GENERATED_SCHEME) (the Scheme wrapper file):
745CHICKEN_GENERATED_SCHEME = $(INTERFACE:.i=.scm)
746CHICKEN_COMPILED_SCHEME = $(INTERFACE:.i=_chicken.c)
747CHICKEN_COMPILED_OBJECT = $(CHICKEN_COMPILED_SCHEME:.c=.@OBJEXT@)
748
749# flags for the main chicken sources (only used when compiling staticly)
750CHICKEN_COMPILED_MAIN = $(CHICKEN_MAIN:.scm=_chicken.c)
751CHICKEN_COMPILED_MAIN_OBJECT = $(CHICKEN_COMPILED_MAIN:.c=.@OBJEXT@)
752
753# -----------------------------------------------------------------
754# Build a CHICKEN dynamically loadable module
755# -----------------------------------------------------------------
756
757chicken: $(SRCS)
758	$(SWIG) -chicken $(SWIGOPT) $(INCLUDE) $(INTERFACE)
759	$(CHICKEN) $(CHICKEN_GENERATED_SCHEME) $(CHICKENOPTS) \
760		-dynamic -feature chicken-compile-shared \
761		-output-file $(CHICKEN_COMPILED_SCHEME)
762	$(CC) -c $(CCSHARED) $(CFLAGS) $(CHICKEN_CFLAGS) \
763		$(INCLUDES) $(CHICKEN_INCLUDE) $(ISRCS) $(SRCS) $(CHICKEN_COMPILED_SCHEME)
764	$(LDSHARED) $(CHICKEN_COMPILED_OBJECT) $(OBJS) $(IOBJS) \
765		$(LIBS) $(CHICKEN_SHAREDLIBOPTS) -o $(LIBPREFIX)$(TARGET)$(SO)
766
767chicken_cpp: $(CXXSRCS) $(CHICKSRCS)
768	$(SWIG) -c++ -chicken $(SWIGOPT) $(INCLUDE) $(INTERFACE)
769	$(CHICKEN) $(CHICKEN_GENERATED_SCHEME) $(CHICKENOPTS) \
770		-dynamic -feature chicken-compile-shared \
771		-output-file $(CHICKEN_COMPILED_SCHEME)
772	$(CXX) -c $(CCSHARED) $(CFLAGS) $(CHICKEN_CFLAGS) \
773		$(INCLUDES) $(CHICKEN_INCLUDE) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(CHICKEN_COMPILED_SCHEME)
774	$(CXXSHARED) $(CHICKEN_COMPILED_OBJECT) $(OBJS) $(IOBJS) \
775		$(LIBS) $(CPP_DLLIBS) $(CHICKEN_SHAREDLIBOPTS) -o $(LIBPREFIX)$(TARGET)$(SO)
776
777# -----------------------------------------------------------------
778# Build statically linked CHICKEN interpreter
779# -----------------------------------------------------------------
780
781# The following two targets are also used by the test suite
782chicken_static: $(SRCS) $(CHICKSRCS)
783	$(SWIG) -chicken $(SWIGOPT) $(INCLUDE) $(INTERFACE)
784	$(CHICKEN) $(CHICKEN_GENERATED_SCHEME) $(CHICKENOPTS) \
785		-output-file $(CHICKEN_COMPILED_SCHEME)
786	$(CHICKEN) $(CHICKEN_MAIN) $(CHICKENOPTS) \
787		-output-file $(CHICKEN_MAIN:.scm=_chicken.c)
788	$(CC) -c $(CCSHARED) $(CFLAGS) $(CHICKEN_CFLAGS) \
789		$(INCLUDES) $(CHICKEN_INCLUDE) $(ISRCS) $(SRCS) \
790		$(CHICKEN_COMPILED_SCHEME) $(CHICKEN_COMPILED_MAIN)
791	$(CC) $(CHICKEN_COMPILED_OBJECT) $(CHICKEN_COMPILED_MAIN_OBJECT) \
792		$(OBJS) $(IOBJS) $(LIBS) $(CHICKEN_SHAREDLIBOPTS) -o $(TARGET)
793
794chicken_static_cpp: $(CXXSRCS) $(CHICKSRCS)
795	$(SWIG) -c++ -chicken $(SWIGOPT) $(INCLUDE) $(INTERFACE)
796	$(CHICKEN) $(CHICKEN_GENERATED_SCHEME) $(CHICKENOPTS) \
797		-output-file $(CHICKEN_COMPILED_SCHEME)
798	$(CHICKEN) $(CHICKEN_MAIN) $(CHICKENOPTS) \
799		-output-file $(CHICKEN_MAIN:.scm=_chicken.c)
800	$(CXX) -c $(CCSHARED) $(CFLAGS) $(CHICKEN_CFLAGS) \
801		$(INCLUDES) $(CHICKEN_INCLUDE) $(ICXXSRCS) $(SRCS) $(CXXSRCS) \
802		$(CHICKEN_COMPILED_SCHEME) $(CHICKEN_COMPILED_MAIN)
803	$(CXX) $(CHICKEN_COMPILED_OBJECT) $(CHICKEN_COMPILED_MAIN_OBJECT) \
804		$(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) $(CHICKEN_SHAREDLIBOPTS) -o $(TARGET)
805
806# ----------------------------------------------------------------
807# Build a shared library using csc
808# ----------------------------------------------------------------
809
810chicken_csc:
811	$(SWIG) -chicken $(SWIGOPT) $(INCLUDE) $(INTERFACE)
812	$(CHICKEN_CSC) -sv $(CHICKEN_GENERATED_SCHEME) $(SRCS) $(ISRCS) -o $(TARGET)$(SO)
813
814chicken_csc_cpp:
815	$(SWIG) -c++ -chicken $(SWIGOPT) $(INCLUDE) $(INTERFACE)
816	$(CHICKEN_CSC) -sv $(CHICKEN_GENERATED_SCHEME) $(SRCS) $(ICXXSRCS) $(CXXSRCS) -o $(TARGET)$(SO)
817
818chicken_clean:
819	rm -f *.@OBJEXT@ *$(SO) *_wrap* *~ .~* core @EXTRA_CLEAN@ *_chicken*
820
821##################################################################
822#####                      CSHARP                           ######
823##################################################################
824
825# Extra CSharp specific dynamic linking options
826CSHARP_DLNK  = @CSHARPDYNAMICLINKING@
827CSHARP_LIBPREFIX = @CSHARPLIBRARYPREFIX@
828CSHARPCOMPILER = @CSHARPCOMPILER@
829CSHARPCILINTERPRETER = @CSHARPCILINTERPRETER@
830CSHARPCFLAGS = @CSHARPCFLAGS@
831CSHARPSO = @CSHARPSO@
832
833# ----------------------------------------------------------------
834# Build a CSharp dynamically loadable module (C)
835# ----------------------------------------------------------------
836
837csharp: $(SRCS)
838	$(SWIG) -csharp $(SWIGOPT) $(INTERFACE)
839	$(CC) -c $(CCSHARED) $(CFLAGS) $(CSHARPCFLAGS) $(SRCS) $(ISRCS) $(INCLUDES)
840	$(LDSHARED) $(OBJS) $(IOBJS) $(CSHARP_DLNK) $(LIBS) -o $(CSHARP_LIBPREFIX)$(TARGET)$(CSHARPSO)
841
842# ----------------------------------------------------------------
843# Build a CSharp dynamically loadable module (C++)
844# ----------------------------------------------------------------
845
846csharp_cpp: $(SRCS)
847	$(SWIG) -csharp -c++ $(SWIGOPT) $(INTERFACE)
848	$(CXX) -c $(CCSHARED) $(CFLAGS) $(CSHARPCFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDES)
849	$(CXXSHARED) $(OBJS) $(IOBJS) $(CSHARP_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(CSHARP_LIBPREFIX)$(TARGET)$(CSHARPSO)
850
851# ----------------------------------------------------------------
852# Compile CSharp files
853# ----------------------------------------------------------------
854
855csharp_compile: $(SRCS)
856	$(CSHARPCOMPILER) $(CSHARPFLAGS) $(CSHARPSRCS)
857
858# -----------------------------------------------------------------
859# Cleaning the CSharp examples
860# -----------------------------------------------------------------
861
862csharp_clean:
863	rm -f *.@OBJEXT@ *@CSHARPSO@ *_wrap* *~ .~* core @EXTRA_CLEAN@ runme runme.exe gc.log `find . -name \*.cs | grep -v runme.cs`
864