Wednesday, October 1, 2008

swig wrap c++ and tcl(Makefile)

TOP = .
SWIG = /home/bingo/bin/swig/bin/swig
CXXSRCS = example.cxx
TARGET = example
INTERFACE = example.i
LIBS = -lm -llapack (make sure to change the lib here, important)

all::
$(MAKE) -f $(TOP)/Makefile.in CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
LIBS='$(LIBS)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' tcl_cpp

static::
$(MAKE) -f $(TOP)/Makefile.in CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
TARGET='mytclsh' INTERFACE='$(INTERFACE)' tclsh_cpp_static

clean::
$(MAKE) -f $(TOP)/Makefile.in tcl_clean

check: all

(if the compiling ends normally, but tcl doesn't run, it might means you are missing some flag during the make)

No comments: