From: Avery Pennarun Date: Sun, 24 Jan 2010 22:44:19 +0000 (-0500) Subject: Makefile: build module using python distutils instead of manually. X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=a2e3433daa1a4661a73220e076b0a35d302482f4;p=packages%2Fb%2Fbup.git Makefile: build module using python distutils instead of manually. This makes it work with fink's version of python, among possibly other things. So now we can build chashsplit.so even on MacOS X tiger, even though tiger's python 2.3 is too old, by installing fink's python24 package first. --- diff --git a/.gitignore b/.gitignore index 6c135e3..88644b6 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ tags2[tc] out[12] out2[tc] *.tmp +/build diff --git a/Makefile b/Makefile index a8f82ff..9393fb0 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,3 @@ -PYINCLUDE:=$(shell python2.5-config --includes) -PYLIB:=$(shell python2.5-config --lib) OS:=$(shell uname | sed 's/[-_].*//') MACHINE:=$(shell uname -m) CFLAGS=-Wall -g -O2 -Werror $(PYINCLUDE) -g @@ -27,8 +25,10 @@ all: bup-split bup-join bup-save bup-init bup-server bup-index bup-tick \ randomgen$(EXT): randomgen.o $(CC) $(CFLAGS) -o $@ $< -chashsplit$(SOEXT): chashsplitmodule.o - $(CC) $(CFLAGS) $(LDFLAGS) $(SHARED) -o $@ $< $(PYLIB) +chashsplit$(SOEXT): chashsplitmodule.c csetup.py + @rm -f $@ + python csetup.py build + cp build/*/chashsplit.so . runtests: all runtests-python runtests-cmdline @@ -68,6 +68,6 @@ bup-%: cmd-%.sh clean: rm -f *.o *.so *.dll *.exe *~ .*~ *.pyc */*.pyc */*~ \ - bup bup-* randomgen \ + bup bup-* randomgen memtest \ out[12] out2[tc] tags[12] tags2[tc] - rm -rf *.tmp + rm -rf *.tmp build diff --git a/csetup.py b/csetup.py new file mode 100644 index 0000000..2590557 --- /dev/null +++ b/csetup.py @@ -0,0 +1,8 @@ +from distutils.core import setup, Extension + +chashsplit_mod = Extension('chashsplit', sources=['chashsplitmodule.c']) + +setup(name='chashsplit', + version='0.1', + description='hashsplit helper library for bup', + ext_modules=[chashsplit_mod])