Makefile 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. PYTHON=`which python`
  2. DESTDIR=/
  3. BUILDIR=$(CURDIR)/debian/python-scattnlay
  4. PROJECT=python-scattnlay
  5. VERSION=0.3.1
  6. all:
  7. @echo "make source - Create source package"
  8. @echo "make cython - Convert Cython code to c++"
  9. @echo "make install - Install on local system"
  10. @echo "make buildrpm - Generate a rpm package"
  11. @echo "make builddeb - Generate a deb package"
  12. @echo "make standalone - Create a standalone program"
  13. @echo "make clean - Delete temporal files"
  14. # make standalone
  15. source:
  16. $(PYTHON) setup.py sdist $(COMPILE) --dist-dir=../
  17. cython: scattnlay.pyx
  18. cython --cplus scattnlay.pyx
  19. install:
  20. $(PYTHON) setup.py install --root $(DESTDIR) $(COMPILE)
  21. buildrpm:
  22. #$(PYTHON) setup.py bdist_rpm --post-install=rpm/postinstall --pre-uninstall=rpm/preuninstall
  23. $(PYTHON) setup.py bdist_rpm --dist-dir=../
  24. builddeb:
  25. # build the source package in the parent directory
  26. # then rename it to project_version.orig.tar.gz
  27. $(PYTHON) setup.py sdist $(COMPILE) --dist-dir=../ --prune
  28. rename -f 's/$(PROJECT)-(.*)\.tar\.gz/$(PROJECT)_$$1\.orig\.tar\.gz/' ../*
  29. # build the package
  30. dpkg-buildpackage -i -I -rfakeroot
  31. standalone: standalone.cc nmie.cc
  32. c++ -DNDEBUG -O2 -std=c++11 standalone.cc nmie.cc nmie-core.cc -lm -o scattnlay
  33. mv scattnlay ../
  34. clean:
  35. $(PYTHON) setup.py clean
  36. $(MAKE) -f $(CURDIR)/debian/rules clean
  37. rm -rf build/ MANIFEST
  38. find . -name '*.pyc' -delete
  39. find . -name '*.o' -delete
  40. find . -name '*.so' -delete