From 6130e39b18b5f53902e4eab14f6d5cdde5219563 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Mon, 1 Nov 2010 01:35:04 -0700 Subject: initial commit of public abc --- src/python/module.make | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 src/python/module.make (limited to 'src/python/module.make') diff --git a/src/python/module.make b/src/python/module.make new file mode 100644 index 00000000..ac56208d --- /dev/null +++ b/src/python/module.make @@ -0,0 +1,64 @@ +# To compile with the embedded python interpreter set +# the variable ABC_PYTHON to point to the python executable +# +# Examples: +# make ABC_PYTHON=/usr/bin/python +# make ABC_PYTHON=/usr/bin/python2.5 +# +# To build the Python extension build the target pyabc +# To create a package of ABC with embedded Python use the target pyabc.tgz + +ifdef ABC_PYTHON + + # get the directory containing this file + ABC_PYTHON_FILES_PREFIX := $(CURDIR)/src/python + + ABC_SWIG := swig + ABC_PYTHON_CONFIG := $(ABC_PYTHON)-config + ABC_PYTHON_CFLAGS := $(shell $(ABC_PYTHON_CONFIG) --includes) -DABC_PYTHON_EMBED=1 + ABC_PYTHON_LDFLAGS := $(shell $(ABC_PYTHON_CONFIG) --ldflags) + + CFLAGS += $(ABC_PYTHON_CFLAGS) + CXXFLAGS += $(ABC_PYTHON_CFLAGS) + LIBS += $(ABC_PYTHON_LDFLAGS) + + ABC_PYTHON_SRC := $(ABC_PYTHON_FILES_PREFIX)/pyabc_wrap.c + + SRC += $(ABC_PYTHON_SRC) + + GARBAGE += \ + $(ABC_PYTHON_SRC) \ + $(ABC_PYTHON_SRC:_wrap.c=.py) \ + $(ABC_PYTHON_SRC:_wrap.c=.pyc) \ + $(ABC_PYTHON_FILES_PREFIX)/build \ + $(ABC_PYTHON_FILES_PREFIX)/dist \ + pyabc.tgz + +%_wrap.c %.py : %.i + $(ABC_SWIG) -python -outdir $(