# HG changeset patch # User sqwishy # Date 1361803714 28800 # Mon Feb 25 06:48:34 2013 -0800 # Node ID c59e5f3560462416934c9ac83972e0424e108ab6 # Parent 198e025bca3e1ae30eed21b9c2b8e873ff140dfc Using a Makefile instead of setup.py and that makeproject thing diff --git a/.hgignore b/.hgignore --- a/.hgignore +++ b/.hgignore @@ -3,3 +3,4 @@ \.pyc$ \.so$ \.o$ +^mandelbro.c$ diff --git a/Makefile b/Makefile new file mode 100644 --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +all: mandelbro.so + +mandelbro.o: + fasm mandelbro.asm mandelbro.o + +mandelbro.c: + cython mandelbro.pyx -o mandelbro.c + +mandelbro.so: mandelbro.o mandelbro.c + gcc cmandelbro.c mandelbro.c mandelbro.o \ + -shared -fPIC \ + `pkg-config --libs opencv python-2.7 --cflags opencv python-2.7` \ + -o mandelbro.so + +test: + # We can import it? Good enough for me ... + python2.7 -c "import mandelbro; mandelbro.render_to_raw((-1,2,3,-4), (10, 10))" + +clean: + rm *.o + rm mandelbro.c diff --git a/makeproject b/makeproject deleted file mode 100755 --- a/makeproject +++ /dev/null @@ -1,8 +0,0 @@ -# Compiles mandelbro.asm -> mandelbrolib.so -fasm mandelbro.asm m.o && ld -shared m.o -o mandelbroasmlib.so && rm -f m.o && \ - -gcc cmandelbro.c mandelbroasmlib.so -shared -fPIC `pkg-config --libs opencv python-2.7 --cflags opencv python-2.7` -o mandelbrolib.so $* && \ - -python2.7 setup.py build_ext --inplace --force $* && \ - -LD_LIBRARY_PATH=`pwd` python2.7 -c "import mandelbro; mandelbro.render_to_raw((-1,2,3,-4), (400, 950))" diff --git a/setup.py b/setup.py deleted file mode 100644 --- a/setup.py +++ /dev/null @@ -1,16 +0,0 @@ -from distutils.core import setup -from distutils.extension import Extension -from Cython.Distutils import build_ext - -ext_modules = [ - Extension('mandelbro', - ['mandelbro.pyx'], - libraries=[':mandelbrolib.so'], - ) -] - -setup( - name = 'Mandelbro rendering library thingy', - cmdclass = {'build_ext': build_ext}, - ext_modules = ext_modules -)