PageRenderTime 75ms CodeModel.GetById 9ms app.highlight 57ms RepoModel.GetById 2ms app.codeStats 0ms

/trunk/Examples/Makefile.in

#
Autoconf | 1300 lines | 703 code | 254 blank | 343 comment | 34 complexity | ba74ebba4bc796140b8a6a7da7e411f0 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

   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, set required variables, eg SRCS, INTERFACE,
  16#      INTERFACEDIR, INCLUDES, LIBS, TARGET, and do a
  17#           $(MAKE) -f Makefile.template.in SRCS='$(SRCS)' \
  18#           INCLUDES='$(INCLUDES) LIBS='$(LIBS)' INTERFACE='$(INTERFACE)' \
  19#           INTERFACEDIR='$(INTERFACEDIR)' 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  =
  34INTERFACEDIR  =
  35INTERFACEPATH = $(INTERFACEDIR)$(INTERFACE)
  36SWIGOPT    =
  37SWIG       = swig
  38
  39LIBM       = @LIBM@
  40LIBC       = @LIBC@
  41LIBCRYPT   = @LIBCRYPT@
  42SYSLIBS    = $(LIBM) $(LIBC) $(LIBCRYPT)
  43LIBPREFIX  =
  44
  45# RUNTOOL is for use with runtime tools, eg set it to valgrind
  46RUNTOOL    =
  47# COMPILETOOL is a way to run the compiler under another tool, or more commonly just to stop the compiler executing
  48COMPILETOOL=
  49
  50# X11 options
  51
  52XLIB       = @XLIBSW@
  53XINCLUDE   = @XINCLUDES@
  54
  55IWRAP      = $(INTERFACE:.i=_wrap.i)
  56ISRCS      = $(IWRAP:.i=.c)
  57ICXXSRCS   = $(IWRAP:.i=.cxx)
  58IOBJS      = $(IWRAP:.i=.@OBJEXT@)
  59
  60##################################################################
  61# Dynamic loading for C++
  62# If you are going to be building dynamic loadable modules in C++,
  63# you may need to edit this line appropriately.
  64#
  65# This line works for g++, but I'm not sure what it might be
  66# for other C++ compilers
  67##################################################################
  68
  69CPP_DLLIBS = #-L/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.7.2 \
  70             -L/usr/local/lib -lg++ -lstdc++ -lgcc
  71
  72# Solaris workshop 5.0
  73# CPP_DLLIBS = -L/opt/SUNWspro/lib -lCrun
  74
  75# Symbols used for using shared libraries
  76SO=		@SO@
  77LDSHARED=	@LDSHARED@
  78CCSHARED=	@CCSHARED@
  79CXXSHARED=      @CXXSHARED@
  80
  81# This is used for building shared libraries with a number of C++
  82# compilers.   If it doesn't work,  comment it out.
  83@TRYLINKINGWITHCXX@
  84
  85OBJS      = $(SRCS:.c=.@OBJEXT@) $(CXXSRCS:.cxx=.@OBJEXT@)
  86
  87distclean:
  88	rm -f Makefile
  89	rm -f guile/Makefile
  90	rm -f xml/Makefile
  91
  92##################################################################
  93#####                       Tcl/Tk                          ######
  94##################################################################
  95
  96# Set these to your local copy of Tcl/Tk.
  97
  98TCL_INCLUDE = @TCLINCLUDE@
  99TCL_LIB     = @TCLLIB@
 100TCL_OPTS    = @LIBS@
 101TK_OPTS     = -ltk -ltcl @LIBS@
 102
 103# Extra Tcl specific dynamic linking options
 104TCL_DLNK   = @TCLDYNAMICLINKING@
 105TCL_SO     = @TCL_SO@
 106TCLLDSHARED = @TCLLDSHARED@
 107TCLCXXSHARED = @TCLCXXSHARED@
 108
 109# -----------------------------------------------------------
 110# Build a new version of the tclsh shell
 111# -----------------------------------------------------------
 112
 113
 114tclsh: $(SRCS)
 115	$(SWIG) -tcl8 $(SWIGOPT) $(TCL_SWIGOPTS) -ltclsh.i $(INTERFACEPATH)
 116	$(CC) $(CFLAGS) $(SRCS) $(ISRCS) $(INCLUDES) $(TCL_INCLUDE) \
 117	$(TCL_LIB)  $(TCL_OPTS) $(LIBS) $(SYSLIBS) -o $(TARGET)
 118
 119tclsh_cpp: $(SRCS)
 120	$(SWIG) -tcl8 -c++ $(SWIGOPT) $(TCL_SWIGOPTS) -ltclsh.i $(INTERFACEPATH)
 121	$(CXX) $(CFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(TCL_INCLUDE) \
 122	$(TCL_LIB) $(TCL_OPTS) $(LIBS) $(SYSLIBS) -o $(TARGET)
 123
 124# -----------------------------------------------------------
 125# Build a new copy of wish
 126# -----------------------------------------------------------
 127
 128wish: $(SRCS)
 129	$(SWIG) -tcl8 $(SWIGOPT) $(TCL_SWIGOPTS) -lwish.i $(INTERFACEPATH)
 130	$(CC) $(CFLAGS) $(SRCS) $(ISRCS) $(INCLUDES) $(TCL_INCLUDE) \
 131	$(XINCLUDE) $(TCL_LIB) $(TK_OPTS) $(XLIB) $(LIBS) $(SYSLIBS) -o $(TARGET)
 132
 133
 134wish_cpp: $(SRCS)
 135	$(SWIG) -tcl8 -c++ $(SWIGOPT) $(TCL_SWIGOPTS) -lwish.i $(INTERFACEPATH)
 136	$(CXX) $(CFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(TCL_INCLUDE) \
 137	$(XINCLUDE) $(TCL_LIB) $(TK_OPTS) $(XLIB) $(LIBS) $(SYSLIBS) -o $(TARGET)
 138
 139# -----------------------------------------------------------
 140# Build a Tcl dynamic loadable module (you might need to tweak this)
 141# -----------------------------------------------------------
 142
 143tcl:  $(SRCS)
 144	$(SWIG) -tcl8 $(SWIGOPT) $(TCL_SWIGOPTS) $(INTERFACEPATH)
 145	$(CC) -c $(CCSHARED) $(CFLAGS) $(SRCS) $(ISRCS) $(INCLUDES) $(TCL_INCLUDE)
 146	$(TCLLDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(TCL_DLNK) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(TCL_SO)
 147
 148# -----------------------------------------------------------
 149# Build a Tcl7.5 dynamic loadable module for C++
 150# -----------------------------------------------------------
 151
 152tcl_cpp: $(SRCS)
 153	$(SWIG) -tcl8 -c++ $(SWIGOPT) $(TCL_SWIGOPTS) $(INTERFACEPATH)
 154	$(CXX) -c $(CCSHARED) $(CFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(TCL_INCLUDE)
 155	$(TCLCXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(TCL_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(TCL_SO)
 156
 157# -----------------------------------------------------------------
 158# Cleaning the Tcl examples
 159# -----------------------------------------------------------------
 160
 161tcl_clean:
 162	rm -f *_wrap* *~ .~* mytclsh@EXEEXT@
 163	rm -f core @EXTRA_CLEAN@
 164	rm -f *.@OBJEXT@ *@SO@
 165
 166##################################################################
 167#####                       PERL 5                          ######
 168##################################################################
 169
 170# You need to set this variable to the Perl5 directory containing the
 171# files "perl.h", "EXTERN.h" and "XSUB.h".   With Perl5.003, it's
 172# usually something like /usr/local/lib/perl5/arch-osname/5.003/CORE.
 173
 174PERL5_INCLUDE= @PERL5EXT@
 175
 176# Extra Perl specific dynamic linking options
 177PERL5_DLNK   = @PERL5DYNAMICLINKING@
 178PERL5_CCFLAGS = @PERL5CCFLAGS@
 179
 180# ----------------------------------------------------------------
 181# Build a Perl5 dynamically loadable module (C)
 182# ----------------------------------------------------------------
 183
 184perl5: $(SRCS)
 185	$(SWIG) -perl5 $(SWIGOPT) $(INTERFACEPATH)
 186	$(CC) -c -Dbool=char $(CCSHARED) $(CFLAGS) $(SRCS) $(ISRCS) $(INCLUDES) $(PERL5_CCFLAGS) -I$(PERL5_INCLUDE)
 187	$(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(PERL5_DLNK) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
 188
 189# ----------------------------------------------------------------
 190# Build a Perl5 dynamically loadable module (C++)
 191# ----------------------------------------------------------------
 192
 193perl5_cpp: $(SRCS)
 194	$(SWIG) -perl5 -c++ $(SWIGOPT) $(INTERFACEPATH)
 195	$(CXX) -c $(CCSHARED) $(CFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(PERL5_CCFLAGS) -I$(PERL5_INCLUDE)
 196	$(CXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(PERL5_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
 197
 198# ----------------------------------------------------------------
 199# Build a module from existing XS C source code.   (ie. from xsubpp).
 200# ----------------------------------------------------------------
 201perl5_xs: $(SRCS)
 202	$(CC) -c $(CCSHARED) $(CFLAGS) $(SRCS) $(INCLUDES) -I$(PERL5_INCLUDE)
 203	$(LDSHARED) $(CFLAGS) $(OBJS) $(LIBS) -o $(TARGET)$(SO)
 204
 205# ----------------------------------------------------------------
 206# Build a statically linked Perl5 executable
 207# ----------------------------------------------------------------
 208
 209PERL5_LIB    = -L$(PERL5_INCLUDE) -l@PERL5LIB@ @LIBS@ $(SYSLIBS)
 210
 211perl5_static: $(SRCS)
 212	$(SWIG) -perl5 -static -lperlmain.i $(SWIGOPT) $(INTERFACEPATH)
 213	$(CC) $(CFLAGS) -Dbool=char $(SRCS) $(ISRCS) $(INCLUDES) -I$(PERL5_INCLUDE) $(PERL5_LIB) $(LIBS) -o $(TARGET)
 214
 215perl5_static_cpp: $(SRCS)
 216	$(SWIG) -perl5 -c++ -static -lperlmain.i $(SWIGOPT) $(INTERFACEPATH)
 217	$(CXX) $(CFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDES) -I$(PERL5_INCLUDE) $(PERL5_LIB) $(LIBS) -o $(TARGET)
 218
 219# -----------------------------------------------------------------
 220# Cleaning the Perl5 examples
 221# -----------------------------------------------------------------
 222
 223perl5_clean:
 224	rm -f *_wrap* *~ .~* myperl@EXEEXT@ *.pm
 225	rm -f core @EXTRA_CLEAN@
 226	rm -f *.@OBJEXT@ *@SO@
 227
 228##################################################################
 229#####                       PYTHON                          ######
 230##################################################################
 231
 232# Make sure these locate your Python installation
 233ifeq (,$(PY3))
 234  PYTHON_INCLUDE= $(DEFS) @PYINCLUDE@
 235  PYTHON_LIB    = @PYLIB@
 236  PYTHON        = @PYTHON@
 237else
 238  PYTHON_INCLUDE= $(DEFS) @PY3INCLUDE@
 239  PYTHON_LIB    = @PY3LIB@
 240  PYTHON        = @PYTHON3@
 241endif
 242
 243# Extra Python specific linking options
 244ifeq (,$(PY3))
 245  PYTHON_DLNK   = @PYTHONDYNAMICLINKING@
 246  PYTHON_LINK   = @PYLINK@
 247else
 248  PYTHON_DLNK   = @PYTHON3DYNAMICLINKING@
 249  PYTHON_LINK   = @PY3LINK@
 250endif
 251PYTHON_SO     = @PYTHON_SO@
 252
 253# SWIG option for Python
 254ifeq (,$(PY3))
 255  SWIGPYTHON = $(SWIG) -python
 256else
 257  SWIGPYTHON = $(SWIG) -python -py3
 258endif
 259
 260# ----------------------------------------------------------------
 261# Build a C dynamically loadable module
 262# ----------------------------------------------------------------
 263
 264python: $(SRCS)
 265	$(SWIGPYTHON) $(SWIGOPT) $(INTERFACEPATH)
 266	$(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(SRCS) $(INCLUDES) $(PYTHON_INCLUDE)
 267	$(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(PYTHON_DLNK) $(LIBS) -o $(LIBPREFIX)_$(TARGET)$(PYTHON_SO)
 268
 269# -----------------------------------------------------------------
 270# Build a C++ dynamically loadable module
 271# -----------------------------------------------------------------
 272
 273python_cpp: $(SRCS)
 274	$(SWIGPYTHON) -c++ $(SWIGOPT) $(INTERFACEPATH)
 275	$(CXX) -c $(CCSHARED) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) $(PYTHON_INCLUDE)
 276	$(CXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(PYTHON_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)_$(TARGET)$(PYTHON_SO)
 277
 278# -----------------------------------------------------------------
 279# Build statically linked Python interpreter
 280#
 281# These should only be used in conjunction with the %include embed.i
 282# library file
 283# -----------------------------------------------------------------
 284
 285#TKINTER = -L/usr/X11R6.3/lib -L/usr/local/compat/lib -ltk4.0 -ltcl7.4 -lX11
 286TKINTER =
 287PYTHON_LIBOPTS = $(PYTHON_LINK) @LIBS@ $(TKINTER) $(SYSLIBS)
 288
 289python_static: $(SRCS)
 290	$(SWIGPYTHON) -lembed.i $(SWIGOPT) $(INTERFACEPATH)
 291	$(CC) $(CFLAGS) @LINKFORSHARED@ $(ISRCS) $(SRCS) $(INCLUDES) \
 292	$(PYTHON_INCLUDE) $(LIBS) -L$(PYTHON_LIB) $(PYTHON_LIBOPTS) -o $(TARGET)
 293
 294python_static_cpp: $(SRCS)
 295	$(SWIGPYTHON) -c++ -lembed.i $(SWIGOPT) $(INTERFACEPATH)
 296	$(CXX) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) \
 297	$(PYTHON_INCLUDE) $(LIBS)  -L$(PYTHON_LIB) $(PYTHON_LIBOPTS) -o $(TARGET)
 298
 299# -----------------------------------------------------------------
 300# Running a Python example
 301# -----------------------------------------------------------------
 302
 303ifeq (,$(PY3))
 304  PYSCRIPT = runme.py
 305else
 306  PYSCRIPT = runme3.py
 307endif
 308
 309PY2TO3 = 2to3 `2to3 -l | grep -v -E "Available|import$$" | awk '{print "-f "$$0}'`
 310
 311python_run: $(PYSCRIPT)
 312	env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH PYTHONPATH=$(srcdir):$$PYTHONPATH $(PYTHON) $(PYSCRIPT) >/dev/null
 313
 314runme3.py: runme.py
 315	cp $< $@
 316	$(PY2TO3) -w $@ >/dev/null 2>&1
 317
 318# -----------------------------------------------------------------
 319# Cleaning the python examples
 320# -----------------------------------------------------------------
 321
 322python_clean:
 323	rm -f *_wrap* *~ .~* mypython@EXEEXT@ *.pyc
 324	rm -f core @EXTRA_CLEAN@
 325	rm -f *.@OBJEXT@ *@SO@ *@PYTHON_SO@
 326	if [ -f runme.py ]; then rm -f runme3.py runme3.py.bak; fi
 327
 328
 329##################################################################
 330#####                       OCTAVE                          ######
 331##################################################################
 332
 333# Make sure these locate your Octave installation
 334OCTAVE_INCLUDE= $(DEFS) @OCTAVEEXT@
 335OCTAVE_LIB    =
 336OCTAVE        = @OCTAVE@ -qf
 337
 338# Extra Octave specific dynamic linking options
 339OCTAVE_DLNK   = @OCTAVEDYNAMICLINKING@
 340OCTAVE_SO     = @OCTAVE_SO@
 341
 342# ----------------------------------------------------------------
 343# Build a C dynamically loadable module
 344# Note: Octave requires C++ compiler when compiling C wrappers
 345# ----------------------------------------------------------------
 346
 347octave: $(SRCS)
 348	$(SWIG) -octave $(SWIGOPT) $(INTERFACEPATH)
 349	$(CXX) -g -c $(CCSHARED) $(CFLAGS) $(ICXXSRCS) $(INCLUDES) -I$(OCTAVE_INCLUDE)
 350	$(CC) -g -c $(CCSHARED) $(CFLAGS) $(SRCS) $(CSRCS) $(INCLUDES)
 351	$(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(OCTAVE_DLNK) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(OCTAVE_SO)
 352
 353# -----------------------------------------------------------------
 354# Build a C++ dynamically loadable module
 355# -----------------------------------------------------------------
 356
 357octave_cpp: $(SRCS)
 358	$(SWIG) -c++ -octave $(SWIGOPT) $(INTERFACEPATH)
 359	$(CXX) -g -c $(CCSHARED) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) -I$(OCTAVE_INCLUDE)
 360	$(CXXSHARED) -g $(CFLAGS) $(OBJS) $(IOBJS) $(OCTAVE_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(OCTAVE_SO)
 361
 362# -----------------------------------------------------------------
 363# Running an Octave example
 364# -----------------------------------------------------------------
 365
 366OCTSCRIPT = runme.m
 367
 368octave_run: $(OCTSCRIPT)
 369	for file in $(OCTSCRIPT); do \
 370	   env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH OCTAVE_PATH=$(srcdir):$$OCTAVE_PATH $(OCTAVE) $$file >/dev/null || break; \
 371	done
 372
 373# -----------------------------------------------------------------
 374# Cleaning the octave examples
 375# -----------------------------------------------------------------
 376
 377octave_clean:
 378	rm -f *_wrap* *~ .~* myoctave@EXEEXT@ *.pyc
 379	rm -f core @EXTRA_CLEAN@
 380	rm -f *.@OBJEXT@ *@SO@ *@OCTAVE_SO@
 381
 382##################################################################
 383#####                       GUILE                           ######
 384##################################################################
 385
 386# Make sure these locate your Guile installation
 387GUILE_INCLUDE = @GUILEINCLUDE@
 388GUILE_LIB     = @GUILELIB@
 389GUILE_SO      = @GUILE_SO@
 390GUILE_LIBPREFIX = lib
 391
 392#------------------------------------------------------------------
 393# Build a dynamically loaded module with passive linkage and the scm interface
 394#------------------------------------------------------------------
 395guile: $(SRCS)
 396	$(SWIG) -guile -scm -Linkage passive $(SWIGOPT) $(INTERFACEPATH)
 397	$(CC) -c $(CCSHARED) $(CFLAGS) $(INCLUDES) $(GUILE_INCLUDE) $(ISRCS) $(SRCS)
 398	$(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) -o $(GUILE_LIBPREFIX)$(TARGET)$(GUILE_SO)
 399
 400guile_cpp: $(SRCS)
 401	$(SWIG) -c++ -guile -scm -Linkage passive $(SWIGOPT) $(INTERFACEPATH)
 402	$(CXX) -c $(CCSHARED) $(CFLAGS) $(INCLUDES) $(GUILE_INCLUDE) $(ICXXSRCS) $(SRCS) $(CXXSRCS)
 403	$(CXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(GUILE_LIBPREFIX)$(TARGET)$(GUILE_SO)
 404
 405guile_externalhdr:
 406	$(SWIG) -guile -external-runtime $(TARGET)
 407
 408#------------------------------------------------------------------
 409# Build a dynamically loaded module with passive linkage and the gh interface
 410#------------------------------------------------------------------
 411guile_gh: $(SRCS)
 412	$(SWIG) -guile -gh -Linkage passive $(SWIGOPT) $(INTERFACEPATH)
 413	$(CC) -c $(CCSHARED) $(CFLAGS) $(INCLUDES) $(GUILE_INCLUDE) $(ISRCS) $(SRCS)
 414	$(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) -o $(GUILE_LIBPREFIX)$(TARGET)$(GUILE_SO)
 415
 416guile_gh_cpp: $(SRCS)
 417	$(SWIG) -c++ -guile -gh -Linkage passive $(SWIGOPT) $(INTERFACEPATH)
 418	$(CXX) -c $(CCSHARED) $(CFLAGS) $(INCLUDES) $(GUILE_INCLUDE) $(ICXXSRCS) $(SRCS) $(CXXSRCS)
 419	$(CXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(GUILE_LIBPREFIX)$(TARGET)$(GUILE_SO)
 420
 421# -----------------------------------------------------------------
 422# Build a dynamically loadable module with passive linkage
 423# -----------------------------------------------------------------
 424
 425guile_passive: $(SRCS)
 426	$(SWIG) -guile -Linkage passive $(SWIGOPT) $(INTERFACEPATH)
 427	$(CC) -c $(CCSHARED) $(CFLAGS) $(INCLUDES) $(GUILE_INCLUDE) $(ISRCS) $(SRCS)
 428	$(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) -o $(GUILE_LIBPREFIX)$(TARGET)$(GUILE_SO)
 429
 430guile_passive_cpp: $(SRCS)
 431	$(SWIG) -c++ -guile -Linkage passive $(SWIGOPT) $(INTERFACEPATH)
 432	$(CXX) -c $(CCSHARED) $(CFLAGS) $(INCLUDES) $(GUILE_INCLUDE) $(ICXXSRCS) $(SRCS) $(CXXSRCS)
 433	$(CXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(GUILE_LIBPREFIX)$(TARGET)$(GUILE_SO)
 434
 435# -----------------------------------------------------------------
 436# Build statically linked Guile interpreter
 437# -----------------------------------------------------------------
 438
 439GUILE_LIBOPTS = @GUILELINK@ @LIBS@ $(SYSLIBS)
 440
 441guile_static: $(SRCS)
 442	$(SWIG) -guile -lguilemain.i -Linkage ltdlmod $(SWIGOPT) $(INTERFACEPATH)
 443	$(CC) $(CFLAGS) $(ISRCS) $(SRCS) $(INCLUDES) \
 444	  -DSWIGINIT="SCM scm_init_$(TARGET)_module(void); scm_init_$(TARGET)_module();" \
 445	  $(GUILE_INCLUDE) $(LIBS) -L$(GUILE_LIB) $(GUILE_LIBOPTS) -o $(TARGET)-guile
 446
 447guile_static_cpp: $(SRCS)
 448	$(SWIG) -c++ -guile -lguilemain.i -Linkage ltdlmod $(SWIGOPT) $(INTERFACEPATH)
 449	$(CXX) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) \
 450	  -DSWIGINIT="SCM scm_init_$(TARGET)_module(void); scm_init_$(TARGET)_module();" \
 451	  $(GUILE_INCLUDE) $(LIBS) -L$(GUILE_LIB) $(GUILE_LIBOPTS) -o $(TARGET)-guile
 452
 453guile_simple: $(SRCS)
 454	$(SWIG) -guile -lguilemain.i -Linkage simple $(SWIGOPT) $(INTERFACEPATH)
 455	$(CC) $(CFLAGS) $(ISRCS) $(SRCS) $(INCLUDES) \
 456	  $(GUILE_INCLUDE) $(LIBS) -L$(GUILE_LIB) $(GUILE_LIBOPTS) -o $(TARGET)-guile
 457
 458guile_simple_cpp: $(SRCS)
 459	$(SWIG) -c++ -guile -lguilemain.i -Linkage simple $(SWIGOPT) $(INTERFACEPATH)
 460	$(CXX) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) \
 461	  $(GUILE_INCLUDE) $(LIBS) -L$(GUILE_LIB) $(GUILE_LIBOPTS) -o $(TARGET)-guile
 462
 463# -----------------------------------------------------------------
 464# Cleaning the Guile examples
 465# -----------------------------------------------------------------
 466
 467guile_clean:
 468	rm -f *_wrap* *~ .~* my-guile@EXEEXT@ $(TARGET)@EXEEXT@
 469	rm -f core @EXTRA_CLEAN@
 470	rm -f *.@OBJEXT@ *@GUILE_SO@
 471
 472##################################################################
 473#####                       JAVA                            ######
 474##################################################################
 475
 476# You need to set this variable to the java directories containing the
 477# files "jni.h" and "md.h"
 478# usually something like /usr/java/include and /usr/java/include/<arch-osname>.
 479JAVA_INCLUDE= @JAVAINC@
 480
 481# Extra Java specific dynamic linking options
 482JAVA_DLNK  = @JAVADYNAMICLINKING@
 483JAVA_LIBPREFIX = @JAVALIBRARYPREFIX@
 484JAVASO =@JAVASO@
 485JAVALDSHARED = @JAVALDSHARED@
 486JAVACXXSHARED = @JAVACXXSHARED@
 487JAVACFLAGS = @JAVACFLAGS@
 488
 489# ----------------------------------------------------------------
 490# Build a java dynamically loadable module (C)
 491# ----------------------------------------------------------------
 492
 493java: $(SRCS)
 494	$(SWIG) -java $(SWIGOPT) $(INTERFACEPATH)
 495	$(CC) -c $(CCSHARED) $(CFLAGS) $(JAVACFLAGS) $(SRCS) $(ISRCS) $(INCLUDES) $(JAVA_INCLUDE)
 496	$(JAVALDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(JAVA_DLNK) $(LIBS) -o $(JAVA_LIBPREFIX)$(TARGET)$(JAVASO)
 497
 498# ----------------------------------------------------------------
 499# Build a java dynamically loadable module (C++)
 500# ----------------------------------------------------------------
 501
 502java_cpp: $(SRCS)
 503	$(SWIG) -java -c++ $(SWIGOPT) $(INTERFACEPATH)
 504	$(CXX) -c $(CCSHARED) $(CFLAGS) $(JAVACFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(JAVA_INCLUDE)
 505	$(JAVACXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(JAVA_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(JAVA_LIBPREFIX)$(TARGET)$(JAVASO)
 506
 507# -----------------------------------------------------------------
 508# Cleaning the java examples
 509# -----------------------------------------------------------------
 510
 511java_clean:
 512	rm -f *_wrap* *~ .~* *.class `find . -name \*.java | grep -v runme.java`
 513	rm -f core @EXTRA_CLEAN@
 514	rm -f *.@OBJEXT@ *@JAVASO@
 515
 516##################################################################
 517#####                      MODULA3                          ######
 518##################################################################
 519
 520MODULA3_INCLUDE= @MODULA3INC@
 521
 522# ----------------------------------------------------------------
 523# Build a modula3 dynamically loadable module (C)
 524# ----------------------------------------------------------------
 525
 526modula3: $(SRCS)
 527	$(SWIG) -modula3 $(SWIGOPT) $(INTERFACEPATH)
 528#	$(CC) -c $(CCSHARED) $(CFLAGS) $(SRCS) $(ISRCS) $(INCLUDES) \
 529#       $(OBJS) $(IOBJS) $(LIBS)
 530
 531modula3_cpp: $(SRCS)
 532	$(SWIG) -modula3 -c++ $(SWIGOPT) $(INTERFACEPATH)
 533
 534# -----------------------------------------------------------------
 535# Cleaning the modula3 examples
 536# -----------------------------------------------------------------
 537
 538modula3_clean:
 539	rm -f *_wrap* *.i3 *.m3
 540	rm -f core @EXTRA_CLEAN@
 541	rm -f *.@OBJEXT@ *@SO@
 542
 543##################################################################
 544#####                       MZSCHEME                        ######
 545##################################################################
 546
 547MZC = @MZC@
 548MZDYNOBJ = @MZDYNOBJ@
 549MZSCHEME_SO = @MZSCHEME_SO@
 550
 551# ----------------------------------------------------------------
 552# Build a C/C++ dynamically loadable module
 553# ----------------------------------------------------------------
 554
 555mzscheme: $(SRCS)
 556	$(SWIG) -mzscheme $(SWIGOPT) $(INTERFACEPATH)
 557	$(COMPILETOOL) $(MZC) `echo $(INCLUDES) | sed 's/-I/++ccf -I/g'` --cc $(ISRCS) $(SRCS)
 558	$(COMPILETOOL) $(MZC) --ld $(TARGET)$(MZSCHEME_SO) $(OBJS) $(IOBJS)
 559
 560mzscheme_cpp: $(SRCS)
 561	$(SWIG) -mzscheme -c++ $(SWIGOPT) $(INTERFACEPATH)
 562	$(COMPILETOOL) $(MZC) `echo $(INCLUDES) | sed 's/-I/++ccf -I/g'` --cc $(ICXXSRCS) $(SRCS) $(CXXSRCS)
 563	$(CXXSHARED) $(CFLAGS) -o $(LIBPREFIX)$(TARGET)$(MZSCHEME_SO) $(OBJS) $(IOBJS) $(MZDYNOBJ) $(CPP_DLLIBS)
 564
 565# -----------------------------------------------------------------
 566# Cleaning the mzscheme examples
 567# -----------------------------------------------------------------
 568
 569mzscheme_clean:
 570	rm -f *_wrap* *~ .~*
 571	rm -f core @EXTRA_CLEAN@
 572	rm -f *.@OBJEXT@ *@SO@
 573
 574##################################################################
 575#####                          Ocaml                         #####
 576##################################################################
 577
 578OCC=@OCAMLC@
 579OCAMLDLGEN=@OCAMLDLGEN@
 580OCAMLFIND=@OCAMLFIND@
 581OCAMLMKTOP=@OCAMLMKTOP@ $(SWIGWHERE)
 582NOLINK ?= false
 583OCAMLPP= -pp "camlp4o ./swigp4.cmo"
 584OCAMLP4WHERE=`$(COMPILETOOL) camlp4 -where`
 585OCAMLCORE=\
 586	rm -rf swig.mli swig.ml swigp4.ml && \
 587	$(SWIG) -ocaml -co swig.mli 2>/dev/null &&  \
 588	$(SWIG) -ocaml -co swig.ml 2>/dev/null &&  \
 589	$(SWIG) -ocaml -co swigp4.ml 2>/dev/null &&  \
 590	$(OCC) -c swig.mli &&  \
 591	$(OCC) -c swig.ml &&  \
 592	$(OCC) -I $(OCAMLP4WHERE) -pp "camlp4o pa_extend.cmo q_MLast.cmo" \
 593		-c swigp4.ml
 594
 595ocaml_static: $(SRCS)
 596	$(OCAMLCORE)
 597	$(SWIG) -ocaml $(SWIGOPT) $(INTERFACEPATH)
 598	$(OCC) -g -c -ccopt -g -ccopt "$(INCLUDES)" $(ISRCS) $(SRCS)
 599	$(OCC) -g -c $(INTERFACE:%.i=%.mli)
 600	$(OCC) -g -c $(INTERFACE:%.i=%.ml)
 601	test -z "$(PROGFILE)" || test -f "$(PROGFILE)" && \
 602		$(OCC) $(OCAMLPP) -c $(PROGFILE)
 603	$(NOLINK) || $(OCC) -g -ccopt -g -cclib -g -custom -o $(TARGET) \
 604		swig.cmo \
 605		$(INTERFACE:%.i=%.cmo) \
 606		$(PROGFILE:%.ml=%.cmo) \
 607		$(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS) -cclib "$(LIBS)"
 608
 609ocaml_dynamic: $(SRCS)
 610	$(OCAMLCORE)
 611	$(SWIG) -ocaml $(SWIGOPT) $(INTERFACEPATH)
 612	$(OCC) -g -c -ccopt -g -ccopt "$(INCLUDES)" $(ISRCS) $(SRCS)
 613	$(CXXSHARED) $(CFLAGS) $(CCSHARED) $(CFLAGS) -o $(INTERFACE:%.i=%@SO@) \
 614		$(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS) $(LIBS)
 615	$(OCAMLDLGEN) $(INTERFACE:%.i=%.ml) $(INTERFACE:%.i=%@SO@) > \
 616		$(INTERFACE:%.i=%_dynamic.ml)
 617	mv $(INTERFACE:%.i=%_dynamic.ml) $(INTERFACE:%.i=%.ml)
 618	rm $(INTERFACE:%.i=%.mli)
 619	$(OCAMLFIND) $(OCC) -g -c -package dl $(INTERFACE:%.i=%.ml)
 620	test -z "$(PROGFILE)" || test -f "$(PROGFILE)" && \
 621		$(OCC) $(OCAMLPP) -c $(PROGFILE)
 622	$(NOLINK) || $(OCAMLFIND) \
 623		$(OCC) -g -ccopt -g -cclib -g -custom -o $(TARGET) \
 624		swig.cmo \
 625		-package dl -linkpkg \
 626		$(INTERFACE:%.i=%.cmo) $(PROGFILE:%.ml=%.cmo)
 627
 628ocaml_static_toplevel: $(SRCS)
 629	$(OCAMLCORE)
 630	$(SWIG) -ocaml $(SWIGOPT) $(INTERFACEPATH)
 631	$(OCC) -g -c -ccopt -g -ccopt "$(INCLUDES)" $(ISRCS) $(SRCS)
 632	$(OCC) -g -c $(INTERFACE:%.i=%.mli)
 633	$(OCC) -g -c $(INTERFACE:%.i=%.ml)
 634	test -z "$(PROGFILE)" || test -f "$(PROGFILE)" && \
 635		$(OCC) $(OCAMLPP) -c $(PROGFILE)
 636	$(NOLINK) || $(OCAMLMKTOP) \
 637		swig.cmo \
 638		-I $(OCAMLP4WHERE) camlp4o.cma swigp4.cmo \
 639		-g -ccopt -g -cclib -g -custom -o $(TARGET)_top \
 640		$(INTERFACE:%.i=%.cmo) \
 641		$(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS) -cclib "$(LIBS)"
 642
 643ocaml_static_cpp: $(SRCS)
 644	$(OCAMLCORE)
 645	$(SWIG) -ocaml -c++ $(SWIGOPT) $(INTERFACEPATH)
 646	cp $(ICXXSRCS) $(ICXXSRCS:%.cxx=%.c)
 647	$(OCC) -cc '$(CXX) -Wno-write-strings' -g -c -ccopt -g -ccopt "-xc++ $(INCLUDES)" \
 648		$(ICXXSRCS:%.cxx=%.c) $(SRCS) $(CXXSRCS)
 649	$(OCC) -g -c $(INTERFACE:%.i=%.mli)
 650	$(OCC) -g -c $(INTERFACE:%.i=%.ml)
 651	test -z "$(PROGFILE)" || test -f "$(PROGFILE)" && \
 652		$(OCC) $(OCAMLPP) -c $(PROGFILE)
 653	$(NOLINK) || $(OCC) -g -ccopt -g -cclib -g -custom -o $(TARGET) \
 654		swig.cmo \
 655		$(INTERFACE:%.i=%.cmo) \
 656		$(PROGFILE:%.ml=%.cmo) \
 657		$(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS) \
 658		-cclib "$(LIBS)" -cc '$(CXX) -Wno-write-strings'
 659
 660ocaml_static_cpp_toplevel: $(SRCS)
 661	$(OCAMLCORE)
 662	$(SWIG) -ocaml -c++ $(SWIGOPT) $(INTERFACEPATH)
 663	cp $(ICXXSRCS) $(ICXXSRCS:%.cxx=%.c)
 664	$(OCC) -cc '$(CXX) -Wno-write-strings' -g -c -ccopt -g -ccopt "-xc++ $(INCLUDES)" \
 665		$(ICXXSRCS:%.cxx=%.c) $(SRCS) $(CXXSRCS)
 666	$(OCC) -g -c $(INTERFACE:%.i=%.mli)
 667	$(OCC) -g -c $(INTERFACE:%.i=%.ml)
 668	test -z "$(PROGFILE)" || test -f "$(PROGFILE)" && \
 669		$(OCC) $(OCAMLPP) -c $(PROGFILE)
 670	$(NOLINK) || $(OCAMLMKTOP) \
 671		swig.cmo \
 672		-I $(OCAMLP4WHERE) dynlink.cma camlp4o.cma swigp4.cmo \
 673		-g -ccopt -g -cclib -g -custom -o $(TARGET)_top \
 674		$(INTERFACE:%.i=%.cmo) \
 675		$(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS) \
 676		-cclib "$(LIBS)" -cc '$(CXX) -Wno-write-strings'
 677
 678ocaml_dynamic_cpp: $(SRCS)
 679	$(OCAMLCORE)
 680	$(SWIG) -ocaml -c++ $(SWIGOPT) $(INTERFACEPATH)
 681	cp $(ICXXSRCS) $(ICXXSRCS:%.cxx=%.c)
 682	$(OCC) -cc '$(CXX) -Wno-write-strings' -g -c -ccopt -g -ccopt "-xc++ $(INCLUDES)" \
 683		$(ICXXSRCS:%.cxx=%.c) $(SRCS) $(CXXSRCS) -ccopt -fPIC
 684	$(CXXSHARED) $(CFLAGS) -o $(INTERFACE:%.i=%@SO@) \
 685		$(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS) \
 686		$(CPP_DLLIBS) $(LIBS)
 687	$(OCAMLDLGEN) $(INTERFACE:%.i=%.ml) $(INTERFACE:%.i=%@SO@) > \
 688		$(INTERFACE:%.i=%_dynamic.ml)
 689	mv $(INTERFACE:%.i=%_dynamic.ml) $(INTERFACE:%.i=%.ml)
 690	rm $(INTERFACE:%.i=%.mli)
 691	$(OCAMLFIND) $(OCC) -g -c -package dl $(INTERFACE:%.i=%.ml)
 692	test -z "$(PROGFILE)" || test -f "$(PROGFILE)" && \
 693		$(OCC) $(OCAMLPP) -c $(PROGFILE)
 694	$(NOLINK) || $(OCAMLFIND) \
 695		swig.cmo \
 696		$(OCC) -cclib -export-dynamic -g -ccopt -g -cclib -g -custom \
 697		-o $(TARGET) \
 698		-package dl -linkpkg \
 699		$(INTERFACE:%.i=%.cmo) $(PROGFILE:%.ml=%.cmo) -cc '$(CXX) -Wno-write-strings'
 700
 701ocaml_clean:
 702	rm -f *_wrap* *~ .~* *.cmo *.cmi $(MLFILE) $(MLFILE)i swig.mli swig.cmi swig.ml swig.cmo swigp4.ml swigp4.cmo
 703	rm -f core @EXTRA_CLEAN@
 704	rm -f *.@OBJEXT@ *@SO@
 705
 706##################################################################
 707#####                       RUBY                            ######
 708##################################################################
 709
 710# Make sure these locate your Ruby installation
 711RUBY_CFLAGS= @RUBYCCDLFLAGS@ $(DEFS)
 712RUBY_INCLUDE= @RUBYINCLUDE@
 713RUBY_LIB     = @RUBYLIB@
 714RUBY_DLNK = @RUBYDYNAMICLINKING@
 715
 716# ----------------------------------------------------------------
 717# Build a C dynamically loadable module
 718# ----------------------------------------------------------------
 719
 720ruby: $(SRCS)
 721	$(SWIG) -ruby $(SWIGOPT) $(INTERFACEPATH)
 722	$(CC) -c $(CCSHARED) $(CFLAGS) $(RUBY_CFLAGS) $(ISRCS) $(SRCS) $(INCLUDES) $(RUBY_INCLUDE)
 723	$(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(RUBY_DLNK) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
 724
 725# -----------------------------------------------------------------
 726# Build a C++ dynamically loadable module
 727# -----------------------------------------------------------------
 728
 729ruby_cpp: $(SRCS)
 730	$(SWIG) -c++ -ruby $(SWIGOPT) $(INTERFACEPATH)
 731	$(CXX) -c $(CCSHARED) $(CFLAGS) $(RUBY_CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) $(RUBY_INCLUDE)
 732	$(CXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(RUBY_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
 733
 734# -----------------------------------------------------------------
 735# Build statically linked Ruby interpreter
 736#
 737# These should only be used in conjunction with the %include embed.i
 738# library file
 739# -----------------------------------------------------------------
 740
 741RUBY_LIBOPTS = @RUBYLINK@ @LIBS@ $(SYSLIBS)
 742
 743ruby_static: $(SRCS)
 744	$(SWIG) -ruby -lembed.i $(SWIGOPT) $(INTERFACEPATH)
 745	$(CC) $(CFLAGS) $(RUBY_CFLAGS) @LINKFORSHARED@ $(ISRCS) $(SRCS) $(INCLUDES) \
 746	$(RUBY_INCLUDE) $(LIBS) -L$(RUBY_LIB) $(RUBY_LIBOPTS) -o $(TARGET)
 747
 748ruby_cpp_static: $(SRCS)
 749	$(SWIG) -c++ -ruby -lembed.i $(SWIGOPT) $(INTERFACEPATH)
 750	$(CXX) $(CFLAGS) $(RUBY_CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) \
 751	$(RUBY_INCLUDE) $(LIBS)  -L$(RUBY_LIB) $(RUBY_LIBOPTS) -o $(TARGET)
 752
 753
 754# -----------------------------------------------------------------
 755# Cleaning the Ruby examples
 756# -----------------------------------------------------------------
 757
 758ruby_clean:
 759	rm -f *_wrap* *~ .~* myruby@EXEEXT@ *.pm
 760	rm -f core @EXTRA_CLEAN@
 761	rm -f *.@OBJEXT@ *@SO@
 762
 763##################################################################
 764#####                       PHP                             ######
 765##################################################################
 766
 767# -------------------------------------------------------------------
 768# Build a PHP dynamically loadable module (C)
 769# -------------------------------------------------------------------
 770
 771PHP_INCLUDE = @PHPINC@
 772PHP_SO      = @PHP_SO@
 773
 774php: $(SRCS)
 775	$(SWIG) -php $(SWIGOPT) $(INTERFACEPATH)
 776	$(CC) -c $(CCSHARED) $(CFLAGS) $(SRCS) $(ISRCS) $(INCLUDES) $(PHP_INCLUDE)
 777	$(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(PHP_SO)
 778
 779# --------------------------------------------------------------------
 780# Build a PHP dynamically loadable module (C++)
 781# --------------------------------------------------------------------
 782
 783php_cpp: $(SRCS)
 784	$(SWIG) -php -cppext cxx -c++ $(SWIGOPT) $(INTERFACEPATH)
 785	$(CXX) -c $(CCSHARED) $(CFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(PHP_INCLUDE)
 786	$(CXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(PHP_SO)
 787
 788# -----------------------------------------------------------------
 789# Running a PHP example
 790# -----------------------------------------------------------------
 791
 792PHP=@PHP@
 793PHPSCRIPT ?= runme.php
 794
 795php_run:
 796	$(RUNTOOL) $(PHP) -n -q -d extension_dir=. -d safe_mode=Off $(PHPSCRIPT)
 797
 798# -----------------------------------------------------------------
 799# Cleaning the PHP examples
 800# -----------------------------------------------------------------
 801
 802php_clean:
 803	rm -f *_wrap* *~ .~* example.php php_example.h
 804	rm -f core @EXTRA_CLEAN@
 805	rm -f *.@OBJEXT@ *@SO@
 806
 807##################################################################
 808#####                       Pike                            ######
 809##################################################################
 810
 811# Make sure these locate your Pike installation
 812PIKE_CFLAGS  = @PIKECCDLFLAGS@ -DHAVE_CONFIG_H
 813PIKE_INCLUDE = @PIKEINCLUDE@
 814PIKE_LIB     = @PIKELIB@
 815PIKE_DLNK    = @PIKEDYNAMICLINKING@
 816
 817# ----------------------------------------------------------------
 818# Build a C dynamically loadable module
 819# ----------------------------------------------------------------
 820
 821pike: $(SRCS)
 822	$(SWIG) -pike $(SWIGOPT) $(INTERFACEPATH)
 823	$(CC) -c $(CCSHARED) $(CFLAGS) $(PIKE_CFLAGS) $(ISRCS) $(SRCS) $(INCLUDES) $(PIKE_INCLUDE)
 824	$(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(PIKE_DLNK) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
 825
 826# -----------------------------------------------------------------
 827# Build a C++ dynamically loadable module
 828# -----------------------------------------------------------------
 829
 830pike_cpp: $(SRCS)
 831	$(SWIG) -c++ -pike $(SWIGOPT) $(INTERFACEPATH)
 832	$(CXX) -c $(CCSHARED) $(CFLAGS) $(PIKE_CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) $(PIKE_INCLUDE)
 833	$(CXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(PIKE_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
 834
 835# -----------------------------------------------------------------
 836# Build statically linked Pike interpreter
 837#
 838# These should only be used in conjunction with the %include embed.i
 839# library file
 840# -----------------------------------------------------------------
 841
 842PIKE_LIBOPTS = @PIKELINK@ @LIBS@ $(SYSLIBS)
 843
 844pike_static: $(SRCS)
 845	$(SWIG) -pike -lembed.i $(SWIGOPT) $(INTERFACEPATH)
 846	$(CC) $(CFLAGS) $(PIKE_CFLAGS) @LINKFORSHARED@ $(ISRCS) $(SRCS) $(INCLUDES) \
 847	$(PIKE_INCLUDE) $(LIBS) -L$(PIKE_LIB) $(PIKE_LIBOPTS) -o $(TARGET)
 848
 849pike_cpp_static: $(SRCS)
 850	$(SWIG) -c++ -pike -lembed.i $(SWIGOPT) $(INTERFACEPATH)
 851	$(CXX) $(CFLAGS) $(PIKE_CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) \
 852	$(PIKE_INCLUDE) $(LIBS)  -L$(PIKE_LIB) $(PIKE_LIBOPTS) -o $(TARGET)
 853
 854# -----------------------------------------------------------------
 855# Cleaning the Pike examples
 856# -----------------------------------------------------------------
 857
 858pike_clean:
 859	rm -f *_wrap* *~ .~* mypike@EXEEXT@
 860	rm -f core @EXTRA_CLEAN@
 861	rm -f *.@OBJEXT@ *@SO@
 862
 863
 864##################################################################
 865#####                      Chicken                          ######
 866##################################################################
 867
 868CHICKEN = @CHICKEN@
 869CHICKEN_CSC = @CHICKEN_CSC@
 870CHICKEN_LIBOPTS = @CHICKENLIB@  $(SYSLIBS)
 871CHICKEN_SHAREDLIBOPTS = @CHICKENSHAREDLIB@  $(SYSLIBS)
 872CHICKEN_CFLAGS = @CHICKENOPTS@
 873CHICKENOPTS = -quiet
 874CHICKEN_MAIN =
 875
 876# SWIG produces $(ISRCS) (the C wrapper file)
 877# and $(CHICKEN_GENERATED_SCHEME) (the Scheme wrapper file):
 878CHICKEN_GENERATED_SCHEME = $(INTERFACE:.i=.scm)
 879CHICKEN_COMPILED_SCHEME = $(INTERFACE:.i=_chicken.c)
 880CHICKEN_COMPILED_OBJECT = $(CHICKEN_COMPILED_SCHEME:.c=.@OBJEXT@)
 881
 882# flags for the main chicken sources (only used when compiling staticly)
 883CHICKEN_COMPILED_MAIN = $(CHICKEN_MAIN:.scm=_chicken.c)
 884CHICKEN_COMPILED_MAIN_OBJECT = $(CHICKEN_COMPILED_MAIN:.c=.@OBJEXT@)
 885
 886# -----------------------------------------------------------------
 887# Build a CHICKEN dynamically loadable module
 888# -----------------------------------------------------------------
 889
 890# This is the old way to build chicken, but it does not work correctly with exceptions
 891chicken_direct: $(SRCS)
 892	$(SWIG) -chicken $(SWIGOPT) $(INCLUDE) $(INTERFACEPATH)
 893	$(CHICKEN) $(CHICKEN_GENERATED_SCHEME) $(CHICKENOPTS) \
 894		-dynamic -feature chicken-compile-shared \
 895		-output-file $(CHICKEN_COMPILED_SCHEME)
 896	$(CC) -c $(CCSHARED) $(CFLAGS) $(CHICKEN_CFLAGS) \
 897		$(INCLUDES) $(CHICKEN_INCLUDE) $(ISRCS) $(SRCS) $(CHICKEN_COMPILED_SCHEME)
 898	$(LDSHARED) $(CFLAGS) $(CHICKEN_COMPILED_OBJECT) $(OBJS) $(IOBJS) \
 899		$(LIBS) $(CHICKEN_SHAREDLIBOPTS) -o $(LIBPREFIX)$(TARGET)$(SO)
 900
 901chicken_direct_cpp: $(CXXSRCS) $(CHICKSRCS)
 902	$(SWIG) -c++ -chicken $(SWIGOPT) $(INCLUDE) $(INTERFACEPATH)
 903	$(CHICKEN) $(CHICKEN_GENERATED_SCHEME) $(CHICKENOPTS) \
 904		-dynamic -feature chicken-compile-shared \
 905		-output-file $(CHICKEN_COMPILED_SCHEME)
 906	$(CXX) -c $(CCSHARED) $(CFLAGS) $(CHICKEN_CFLAGS) \
 907		$(INCLUDES) $(CHICKEN_INCLUDE) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(CHICKEN_COMPILED_SCHEME)
 908	$(CXXSHARED) $(CFLAGS) $(CHICKEN_COMPILED_OBJECT) $(OBJS) $(IOBJS) \
 909		$(LIBS) $(CPP_DLLIBS) $(CHICKEN_SHAREDLIBOPTS) -o $(LIBPREFIX)$(TARGET)$(SO)
 910
 911# -----------------------------------------------------------------
 912# Build statically linked CHICKEN interpreter
 913# -----------------------------------------------------------------
 914
 915# The following two targets are also used by the test suite
 916chicken_static: $(SRCS) $(CHICKSRCS)
 917	$(SWIG) -chicken $(SWIGOPT) $(INCLUDE) $(INTERFACEPATH)
 918	$(CHICKEN) $(CHICKEN_GENERATED_SCHEME) $(CHICKENOPTS) \
 919		-output-file $(CHICKEN_COMPILED_SCHEME)
 920	$(CHICKEN) $(CHICKEN_MAIN) $(CHICKENOPTS) \
 921		-output-file $(CHICKEN_MAIN:.scm=_chicken.c)
 922	$(CC) -c $(CCSHARED) $(CFLAGS) $(CHICKEN_CFLAGS) \
 923		$(INCLUDES) $(CHICKEN_INCLUDE) $(ISRCS) $(SRCS) \
 924		$(CHICKEN_COMPILED_SCHEME) $(CHICKEN_COMPILED_MAIN)
 925	$(CC) $(CHICKEN_COMPILED_OBJECT) $(CHICKEN_COMPILED_MAIN_OBJECT) \
 926		$(OBJS) $(IOBJS) $(LIBS) $(CHICKEN_SHAREDLIBOPTS) -o $(TARGET)
 927
 928chicken_static_cpp: $(CXXSRCS) $(CHICKSRCS)
 929	$(SWIG) -c++ -chicken $(SWIGOPT) $(INCLUDE) $(INTERFACEPATH)
 930	$(CHICKEN) $(CHICKEN_GENERATED_SCHEME) $(CHICKENOPTS) \
 931		-output-file $(CHICKEN_COMPILED_SCHEME)
 932	$(CHICKEN) $(CHICKEN_MAIN) $(CHICKENOPTS) \
 933		-output-file $(CHICKEN_MAIN:.scm=_chicken.c)
 934	$(CXX) -c $(CCSHARED) $(CFLAGS) $(CHICKEN_CFLAGS) \
 935		$(INCLUDES) $(CHICKEN_INCLUDE) $(ICXXSRCS) $(SRCS) $(CXXSRCS) \
 936		$(CHICKEN_COMPILED_SCHEME) $(CHICKEN_COMPILED_MAIN)
 937	$(CXX) $(CHICKEN_COMPILED_OBJECT) $(CHICKEN_COMPILED_MAIN_OBJECT) \
 938		$(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) $(CHICKEN_SHAREDLIBOPTS) -o $(TARGET)
 939
 940# ----------------------------------------------------------------
 941# Build a shared library using csc
 942# ----------------------------------------------------------------
 943
 944chicken:
 945	$(SWIG) -chicken $(SWIGOPT) $(INCLUDE) $(INTERFACEPATH)
 946	$(COMPILETOOL) $(CHICKEN_CSC) -s `echo $(INCLUDES) | sed 's/-I/-C -I/g'` $(CHICKEN_GENERATED_SCHEME) $(SRCS) $(ISRCS) -o $(TARGET)$(SO)
 947
 948chicken_cpp:
 949	$(SWIG) -c++ -chicken $(SWIGOPT) $(INCLUDE) $(INTERFACEPATH)
 950	$(COMPILETOOL) $(CHICKEN_CSC) -s `echo $(INCLUDES) | sed 's/-I/-C -I/g'` $(CHICKEN_GENERATED_SCHEME) $(SRCS) $(ICXXSRCS) $(CXXSRCS) -o $(TARGET)$(SO)
 951
 952chicken_externalhdr:
 953	$(SWIG) -chicken -external-runtime $(TARGET)
 954
 955chicken_clean:
 956	rm -f *_wrap* *~ .~* *_chicken*
 957	rm -f core @EXTRA_CLEAN@
 958	rm -f *.@OBJEXT@ *@SO@
 959
 960##################################################################
 961#####                      CSHARP                           ######
 962##################################################################
 963
 964# Extra CSharp specific dynamic linking options
 965CSHARP_DLNK  = @CSHARPDYNAMICLINKING@
 966CSHARP_LIBPREFIX = @CSHARPLIBRARYPREFIX@
 967CSHARPCOMPILER = @CSHARPCOMPILER@
 968CSHARPCILINTERPRETER = @CSHARPCILINTERPRETER@
 969CSHARPCFLAGS = @CSHARPCFLAGS@
 970CSHARPSO = @CSHARPSO@
 971
 972# ----------------------------------------------------------------
 973# Build a CSharp dynamically loadable module (C)
 974# ----------------------------------------------------------------
 975
 976csharp: $(SRCS)
 977	$(SWIG) -csharp $(SWIGOPT) $(INTERFACEPATH)
 978	$(CC) -c $(CCSHARED) $(CFLAGS) $(CSHARPCFLAGS) $(SRCS) $(ISRCS) $(INCLUDES)
 979	$(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(CSHARP_DLNK) $(LIBS) -o $(CSHARP_LIBPREFIX)$(TARGET)$(CSHARPSO)
 980
 981# ----------------------------------------------------------------
 982# Build a CSharp dynamically loadable module (C++)
 983# ----------------------------------------------------------------
 984
 985csharp_cpp: $(SRCS)
 986	$(SWIG) -csharp -c++ $(SWIGOPT) $(INTERFACEPATH)
 987	$(CXX) -c $(CCSHARED) $(CFLAGS) $(CSHARPCFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDES)
 988	$(CXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(CSHARP_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(CSHARP_LIBPREFIX)$(TARGET)$(CSHARPSO)
 989
 990# ----------------------------------------------------------------
 991# Compile CSharp files
 992# ----------------------------------------------------------------
 993
 994csharp_compile: $(SRCS)
 995	$(COMPILETOOL) $(CSHARPCOMPILER) $(CSHARPFLAGS) $(CSHARPSRCS)
 996
 997# -----------------------------------------------------------------
 998# Cleaning the CSharp examples
 999# -----------------------------------------------------------------
1000
1001csharp_clean:
1002	rm -f *_wrap* *~ .~* runme runme.exe *.exe.mdb gc.log `find . -name \*.cs | grep -v runme.cs`
1003	rm -f core @EXTRA_CLEAN@
1004	rm -f *.@OBJEXT@ *@CSHARPSO@
1005
1006##################################################################
1007#####                      LUA                              ######
1008##################################################################
1009
1010# lua flags
1011LUA_INCLUDE= @LUAFLAGS@
1012LUA_LIB    = @LUALINK@
1013
1014# Extra specific dynamic linking options
1015LUA_DLNK   = @LUADYNAMICLINKING@
1016LUA_SO     = @LUA_SO@
1017
1018# Extra code for lua static link
1019LUA_INTERP     = ../lua.c
1020
1021# ----------------------------------------------------------------
1022# Build a C dynamically loadable module
1023# ----------------------------------------------------------------
1024
1025lua: $(SRCS)
1026	$(SWIG) -lua $(SWIGOPT) $(INTERFACEPATH)
1027	$(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(SRCS) $(INCLUDES) $(LUA_INCLUDE)
1028	$(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(LUA_LIB) -o $(LIBPREFIX)$(TARGET)$(LUA_SO)
1029
1030# -----------------------------------------------------------------
1031# Build a C++ dynamically loadable module
1032# -----------------------------------------------------------------
1033
1034lua_cpp: $(SRCS)
1035	$(SWIG) -c++ -lua $(SWIGOPT) $(INTERFACEPATH)
1036	$(CXX) -c $(CCSHARED) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) $(LUA_INCLUDE)
1037	$(CXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(LUA_LIB) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(LUA_SO)
1038
1039# -----------------------------------------------------------------
1040# Build statically linked Lua interpreter
1041# -----------------------------------------------------------------
1042
1043lua_static: $(SRCS)
1044	$(SWIG) -lua -module example $(SWIGOPT) $(INTERFACEPATH)
1045	$(CC) $(CFLAGS)  $(ISRCS) $(SRCS) $(LUA_INTERP) $(INCLUDES) \
1046	$(LUA_INCLUDE) $(LIBS) $(LUA_LIB) -o $(TARGET)
1047
1048lua_static_cpp: $(SRCS)
1049	$(SWIG) -c++ -lua -module example $(SWIGOPT) $(INTERFACEPATH)
1050	$(CXX) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(LUA_INTERP) $(INCLUDES) \
1051	$(LUA_INCLUDE) $(LIBS)  $(LUA_LIB) -o $(TARGET)
1052
1053# -----------------------------------------------------------------
1054# Cleaning the lua examples
1055# -----------------------------------------------------------------
1056
1057lua_clean:
1058	rm -f *_wrap* *~ .~* mylua@EXEEXT@
1059	rm -f core @EXTRA_CLEAN@
1060	rm -f *.@OBJEXT@ *@SO@
1061
1062##################################################################
1063#####                   ALLEGRO CL                          ######
1064##################################################################
1065
1066allegrocl: $(SRCS)
1067	$(SWIG) -allegrocl -cwrap $(SWIGOPT) $(INTERFACEPATH)
1068	$(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(INCLUDES) $(SRCS)
1069	$(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
1070
1071allegrocl_cpp: $(SRCS)
1072	$(SWIG) -c++ -allegrocl $(SWIGOPT) $(INTERFACEPATH)
1073	$(CXX) -c $(CCSHARED) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES)
1074	$(CXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
1075
1076allegrocl_clean:
1077	rm -f *_wrap* *~ .~*
1078	rm -f core @EXTRA_CLEAN@
1079	rm -f *.@OBJEXT@ *@SO@
1080
1081##################################################################
1082#####                      CLISP                            ######
1083##################################################################
1084
1085clisp: $(SRCS)
1086	$(SWIG) -clisp $(SWIGOPT) $(INTERFACEPATH)
1087
1088clisp_cpp: $(SRCS)
1089	$(SWIG) -c++ -clisp $(SWIGOPT) $(INTERFACEPATH)
1090
1091clisp_clean:
1092	rm -f *_wrap* *~ .~*
1093	rm -f core @EXTRA_CLEAN@
1094	rm -f *.@OBJEXT@ *@SO@
1095
1096##################################################################
1097#####                      CFFI                             ######
1098##################################################################
1099
1100cffi: $(SRCS)
1101	$(SWIG) -cffi $(SWIGOPT) $(INTERFACEPATH)
1102#	$(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(INCLUDES) $(SRCS)
1103#	$(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
1104
1105cffi_cpp: $(SRCS)
1106	$(SWIG) -c++ -cffi $(SWIGOPT) $(INTERFACEPATH)
1107	$(CXX) -c $(CCSHARED) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES)
1108	$(CXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
1109
1110cffi_clean:
1111	rm -f *_wrap* *~ .~*
1112	rm -f core @EXTRA_CLEAN@
1113	rm -f *.@OBJEXT@ *@SO@
1114
1115##################################################################
1116#####                      UFFI                             ######
1117##################################################################
1118
1119uffi: $(SRCS)
1120	$(SWIG) -uffi $(SWIGOPT) $(INTERFACEPATH)
1121#	$(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(INCLUDES) $(SRCS)
1122#	$(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
1123
1124uffi_cpp: $(SRCS)
1125	$(SWIG) -c++ -uffi $(SWIGOPT) $(INTERFACEPATH)
1126#	$(CXX) -c $(CCSHARED) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES)
1127#	$(CXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
1128
1129uffi_clean:
1130	rm -f *_wrap* *~ .~*
1131	rm -f core @EXTRA_CLEAN@
1132	rm -f *.@OBJEXT@ *@SO@
1133
1134##################################################################
1135#####                      R                                ######
1136##################################################################
1137
1138R = R
1139RCXXSRCS = $(INTERFACE:.i=_wrap.cpp) #Need to use _wrap.cpp for R build system as it does not understand _wrap.cxx
1140RRSRC = $(INTERFACE:.i=.R)
1141R_CFLAGS=-fPIC
1142
1143# need to compile .cxx files outside of R build system to make sure that
1144# we get -fPIC
1145
1146r: $(SRCS)
1147	$(SWIG) -r $(SWIGOPT) $(INTERFACEPATH)
1148ifneq ($(SRCS),)
1149	$(CXX) -g -c $(CFLAGS) $(R_CFLAGS) $(SRCS) $(INCLUDES) 
1150endif
1151	+( PKG_CPPFLAGS="$(INCLUDES)" $(COMPILETOOL) $(R) CMD SHLIB -o $(LIBPREFIX)$(TARGET)$(SO) $(ISRCS) $(OBJS) )
1152
1153r_cpp: $(CXXSRCS)
1154	$(SWIG) -c++ -r $(SWIGOPT) -o $(RCXXSRCS) $(INTERFACEPATH)
1155ifneq ($(CXXSRCS),)
1156	$(CXX) -g -c $(CFLAGS) $(R_CFLAGS) $(CXXSRCS) $(INCLUDES) 
1157endif
1158	+( PKG_CPPFLAGS="$(INCLUDES)" $(COMPILETOOL) $(R) CMD SHLIB -o $(LIBPREFIX)$(TARGET)$(SO) $(RCXXSRCS) $(OBJS) )
1159
1160r_clean:
1161	rm -f *_wrap* *~ .~*
1162	rm -f core @EXTRA_CLEAN@
1163	rm -f *.@OBJEXT@ *@SO@ NAMESPACE
1164	rm -f $(RRSRC) runme.Rout .RData
1165
1166##################################################################
1167#####                        Go                             ######
1168##################################################################
1169
1170GO = @GO@
1171GOGCC = @GOGCC@
1172GO1 = @GO1@
1173GOC = @GOC@
1174
1175GOSWIGARG = `if $(GOGCC) ; then echo -gccgo; fi`
1176GOCOMPILEARG = `if $(GOGCC) ; then echo -c -g; elif $(GO1) ; then echo tool $(GOC:c=g) ; fi`
1177
1178GOSRCS = $(INTERFACE:.i=.go)
1179GOCSRCS = $(INTERFACE:.i=_gc.c)
1180
1181GOLD = $(GOC:c=l)
1182GOTOOL = `if $(GO1) ; then echo go tool; fi`
1183GOPACK = `if $(GO1) ; then echo go tool pack; else echo gopack; fi`
1184
1185GOPACKAGE = $(INTERFACE:.i=.a)
1186
1187GOOBJEXT = $(GOC:c=)
1188GOGCOBJS = $(GOSRCS:.go=.$(GOOBJEXT))
1189GOGCCOBJS = $(GOSRCS:.go=.@OBJEXT@)
1190
1191# ----------------------------------------------------------------
1192# Build a Go dynamically loadable module (C)
1193# ----------------------------------------------------------------
1194
1195go: $(SRCS)
1196	$(SWIG) -go $(GOSWIGARG) $(SWIGOPT) $(INTERFACEPATH)
1197	$(CC) -g -c $(CCSHARED) $(CFLAGS) $(SRCS) $(ISRCS) $(INCLUDES)
1198	$(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
1199	$(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(GOSRCS)
1200	if ! $(GOGCC) ; then \
1201	  $(COMPILETOOL) $(GOTOOL) $(GOC) -I $${GOROOT}/pkg/$${GOOS}_$${GOARCH} $(GOCSRCS) && \
1202	  $(COMPILETOOL) $(GOPACK) grc $(GOPACKAGE) $(GOGCOBJS) $(GOCSRCS:.c=.$(GOOBJEXT)); \
1203	fi
1204
1205# ----------------------------------------------------------------
1206# Build a Go dynamically loadable module (C++)
1207# ----------------------------------------------------------------
1208
1209go_cpp: $(SRCS)
1210	$(SWIG) -go -c++ $(GOSWIGARG) $(SWIGOPT) $(INTERFACEPATH)
1211	$(CXX) -g -c $(CCSHARED) $(CFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDES)
1212	$(CXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
1213	$(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(GOSRCS)
1214	if ! $(GOGCC) ; then \
1215	  $(COMPILETOOL) $(GOTOOL) $(GOC) -I $${GOROOT}/pkg/$${GOOS}_$${GOARCH} $(GOCSRCS) && \
1216	  $(COMPILETOOL) $(GOPACK) grc $(GOPACKAGE) $(GOGCOBJS) $(GOCSRCS:.c=.$(GOOBJEXT)); \
1217	fi
1218
1219# -----------------------------------------------------------------
1220# Running a Go example
1221# -----------------------------------------------------------------
1222
1223go_run: runme.go
1224	$(GO) $(GOCOMPILEARG) runme.go
1225	if $(GOGCC) ; then \
1226	  $(COMPILETOOL) $(GO) -o runme runme.@OBJEXT@ $(GOGCCOBJS) $(LIBPREFIX)$(TARGET)$(SO); \
1227	else \
1228	  $(COMPILETOOL) $(GOTOOL) $(GOLD) -r $${GOROOT}/pkg/$${GOOS}_$${GOARCH}:. -o runme runme.$(GOOBJEXT); \
1229	fi
1230	env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) ./runme
1231
1232# -----------------------------------------------------------------
1233# Cleaning the Go examples
1234# -----------------------------------------------------------------
1235
1236go_clean:
1237	rm -f *_wrap* *_gc* .~* runme
1238	rm -f core @EXTRA_CLEAN@
1239	rm -f *.@OBJEXT@ *.[568] *.a *@SO@
1240
1241##################################################################
1242#####                         D                             ######
1243##################################################################
1244
1245DLIBPREFIX = @DLIBPREFIX@
1246
1247ifeq (,$(D_VERSION))
1248  D_VERSION = @DDEFAULTVERSION@
1249endif
1250
1251ifeq (2,$(D_VERSION))
1252  SWIGD = $(SWIG) -d -d2
1253  DCOMPILER = @D2COMPILER@
1254else
1255  SWIGD = $(SWIG) -d
1256  DCOMPILER = @D1COMPILER@
1257endif
1258
1259# ----------------------------------------------------------------
1260# Build a dynamically loadable D wrapper for a C module
1261# ----------------------------------------------------------------
1262
1263d: $(SRCS)
1264	$(SWIGD) $(SWIGOPT) $(INTERFACEPATH)
1265	$(CC) -c $(CCSHARED) $(CFLAGS) $(DCFLAGS) $(EXTRA_CFLAGS) $(SRCS) $(ISRCS) $(INCLUDES)
1266	$(LDSHARED) $(CFLAGS) $(DCFLAGS) $(EXTRA_LDFLAGS) $(OBJS) $(IOBJS) $(LIBS) -o $(DLIBPREFIX)$(TARGET)$(SO)
1267
1268# ----------------------------------------------------------------
1269# Build a dynamically loadable D wrapper for a C++ module
1270# ----------------------------------------------------------------
1271
1272d_cpp: $(SRCS)
1273	$(SWIGD) -c++ $(SWIGOPT) $(INTERFACEPATH)
1274	$(CXX) -c $(CCSHARED) $(CFLAGS) $(DCFLAGS) $(EXTRA_CFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDES)
1275	$(CXXSHARED) $(CFLAGS) $(DCFLAGS) $(EXTRA_LDFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(DLIBPREFIX)$(TARGET)$(SO)
1276
1277# ----------------------------------------------------------------
1278# Compile D files
1279# ----------------------------------------------------------------
1280
1281# Clear the DFLAGS environment variable for the compiler call itself
1282# to work around a discrepancy in argument handling between DMD and L…

Large files files are truncated, but you can click here to view the full file