SHARE
TWEET

Untitled

a guest Sep 23rd, 2013 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Makefile for creating our standalone Cython program
  2. PYTHON=python
  3. PYVERSION=$(shell $(PYTHON) -c "import sys; print(sys.version[:3])")
  4.  
  5. INCDIR=$(shell $(PYTHON) -c "from distutils import sysconfig; print(sysconfig.get_python_inc())")
  6. PLATINCDIR=$(shell $(PYTHON) -c "from distutils import sysconfig; print(sysconfig.get_python_inc(plat_specific=True))")
  7. LIBDIR1=$(shell $(PYTHON) -c "from distutils import sysconfig; print(sysconfig.get_config_var('LIBDIR'))")
  8. LIBDIR2=$(shell $(PYTHON) -c "from distutils import sysconfig; print(sysconfig.get_config_var('LIBPL'))")
  9. PYLIB=$(shell $(PYTHON) -c "from distutils import sysconfig; print(sysconfig.get_config_var('LIBRARY')[3:-2])")
  10.  
  11. CC=$(shell $(PYTHON) -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('CC'))")
  12. LINKCC=$(shell $(PYTHON) -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LINKCC'))")
  13. LINKFORSHARED=$(shell $(PYTHON) -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LINKFORSHARED'))")
  14. LIBS=$(shell $(PYTHON) -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBS'))")
  15. SYSLIBS= $(shell $(PYTHON) -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('SYSLIBS'))")
  16.  
  17. fib: fib.o
  18.         $(LINKCC) -o $@ $^ -L$(LIBDIR1) -L$(LIBDIR2) -l$(PYLIB) $(LIBS) $(SYSLIBS) $(LINKFORSHARED)
  19.  
  20. fib.o: fib.c
  21.         $(CC) -c $^ -I$(INCDIR) -I$(PLATINCDIR)
  22.  
  23. CYTHON=/usr/local/bin/cython
  24. fib.c: fib.pyx
  25.         @$(PYTHON) $(CYTHON) --embed fib.pyx
  26.  
  27. all: fib
  28.  
  29. clean:
  30.         @echo Cleaning Demos/embed
  31.         @rm -f *~ *.o *.so core core.* *.c fib test.output
RAW Paste Data
Top