summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile20
1 files changed, 20 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..b682e4d
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,20 @@
+PYTHON_INCLUDES=$(shell python-config --includes)
+
+all: M2Crypto_ext
+
+clean:
+ $(RM) _M2Crypto_ext.so M2Crypto_ext.py* M2Crypto_ext_wrap.c M2Crypto_ext_wrap.o
+
+M2Crypto_ext: _M2Crypto_ext.so M2Crypto_ext.py
+
+M2Crypto_ext.py: M2Crypto_ext.i
+ swig -python -I/usr/include $<
+
+M2Crypto_ext_wrap.c: M2Crypto_ext.i
+ swig -python -I/usr/include $<
+
+M2Crypto_ext_wrap.o: M2Crypto_ext_wrap.c
+ gcc -O2 -fPIC -o $@ -c $< $(PYTHON_INCLUDES)
+
+_M2Crypto_ext.so: M2Crypto_ext_wrap.o
+ gcc -shared -o $@ $<