add a simple swig example (from the turorial)

This commit is contained in:
neingeist 2014-05-05 14:55:58 +02:00
parent 710e4c3657
commit 12d1807d1e
4 changed files with 71 additions and 0 deletions

22
Makefile Normal file
View file

@ -0,0 +1,22 @@
.PHONY: default
default: all test
.PHONY: all
all: _test_swig.so
.PHONY: test
test:
python2.7 test_swig_test.py
_test_swig.so: test_swig.o
ld -shared test_swig.o test_swig_wrap.o -o _test_swig.so
test_swig.o: test_swig_wrap.c
gcc -fpic -c test_swig.c test_swig_wrap.c -I/usr/include/python2.7
test_swig_wrap.c: test_swig.i
swig -python $<
.PHONY: clean
clean:
rm -f *.o *.so test_swig_wrap.c *.pyc test_swig.py