Makefile 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. PYTHON=python
  2. SETUPFLAGS=
  3. COMPILEFLAGS=
  4. INSTALLFLAGS=
  5. PYTHONS=python2.6 python2.7 python3.1 python3.2 python3.3 python3.4
  6. .PHONY: inplace all rebuild test_inplace test fulltests clean distclean
  7. .PHONY: sdist install
  8. all: inplace README.html
  9. README.html: README.txt CHANGES.txt void.css
  10. @echo | cat README.txt - CHANGES.txt | \
  11. rst2html --verbose --exit-status=1 --stylesheet=void.css \
  12. > README.html
  13. inplace:
  14. $(PYTHON) setup.py $(SETUPFLAGS) build_ext -i $(COMPILEFLAGS)
  15. rebuild: clean all
  16. test_inplace: inplace
  17. $(PYTHON) -m tests
  18. test: test_inplace
  19. fulltest:
  20. $(MAKE) clean
  21. @set -e; \
  22. for python in $(PYTHONS); do \
  23. if [ -z $$(which $$python) ]; then \
  24. echo "*** $$python not found ***\n"; \
  25. continue; \
  26. fi; \
  27. echo "*** $$python ***"; \
  28. $$python $(SETUPFLAGS) setup.py -q test; \
  29. echo ""; \
  30. done
  31. $(MAKE) clean
  32. clean:
  33. @find . \( -name '*.o' -or -name '*.so' -or -name '*.sl' -or \
  34. -name '*.py[cod]' -or -name README.html \) \
  35. -and -type f -delete
  36. distclean: clean
  37. @rm -rf build
  38. @rm -rf dist
  39. @find . \( -name '~*' -or -name '*.orig' -or -name '*.bak' -or \
  40. -name 'core*' \) -and -type f -delete
  41. whitespace:
  42. @find \( -name '*.rst' -or -name '*.py' -or -name '*.xml' \) | \
  43. xargs sed -i 's/[ \t]*$$//'
  44. sdist: README.html
  45. $(PYTHON) setup.py sdist --formats gztar,zip
  46. install:
  47. $(PYTHON) setup.py $(SETUPFLAGS) build $(COMPILEFLAGS)
  48. $(PYTHON) setup.py install $(INSTALLFLAGS)