Makefile 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. PROJ=billiard
  2. PYTHON=python
  3. GIT=git
  4. TOX=tox
  5. NOSETESTS=nosetests
  6. ICONV=iconv
  7. FLAKE8=flake8
  8. FLAKEPLUS=flakeplus
  9. SPHINX2RST=sphinx2rst
  10. SPHINX_DIR=docs/
  11. SPHINX_BUILDDIR="${SPHINX_DIR}/_build"
  12. README=README.rst
  13. README_SRC="docs/templates/readme.txt"
  14. CONTRIBUTING=CONTRIBUTING.rst
  15. CONTRIBUTING_SRC="docs/contributing.rst"
  16. SPHINX_HTMLDIR="${SPHINX_BUILDDIR}/html"
  17. DOCUMENTATION=Documentation
  18. FLAKEPLUSTARGET=2.7
  19. all: help
  20. help:
  21. @echo "docs - Build documentation."
  22. @echo "test-all - Run tests for all supported python versions."
  23. @echo "distcheck ---------- - Check distribution for problems."
  24. @echo " test - Run unittests using current python."
  25. @echo " lint ------------ - Check codebase for problems."
  26. @echo " apicheck - Check API reference coverage."
  27. @echo " configcheck - Check configuration reference coverage."
  28. @echo " readmecheck - Check README.rst encoding."
  29. @echo " contribcheck - Check CONTRIBUTING.rst encoding"
  30. @echo " flakes -------- - Check code for syntax and style errors."
  31. @echo " flakecheck - Run flake8 on the source code."
  32. @echo " flakepluscheck - Run flakeplus on the source code."
  33. @echo "readme - Regenerate README.rst file."
  34. @echo "contrib - Regenerate CONTRIBUTING.rst file"
  35. @echo "clean-dist --------- - Clean all distribution build artifacts."
  36. @echo " clean-git-force - Remove all uncomitted files."
  37. @echo " clean ------------ - Non-destructive clean"
  38. @echo " clean-pyc - Remove .pyc/__pycache__ files"
  39. @echo " clean-docs - Remove documentation build artifacts."
  40. @echo " clean-build - Remove setup artifacts."
  41. clean: clean-docs clean-pyc clean-build
  42. clean-dist: clean clean-git-force
  43. Documentation:
  44. (cd "$(SPHINX_DIR)"; $(MAKE) html)
  45. mv "$(SPHINX_HTMLDIR)" $(DOCUMENTATION)
  46. docs: Documentation
  47. clean-docs:
  48. -rm -rf "$(SPHINX_BUILDDIR)"
  49. lint: flakecheck apicheck configcheck readmecheck
  50. apicheck:
  51. (cd "$(SPHINX_DIR)"; $(MAKE) apicheck)
  52. configcheck:
  53. (cd "$(SPHINX_DIR)"; $(MAKE) configcheck)
  54. flakecheck:
  55. $(FLAKE8) "$(PROJ)"
  56. flakediag:
  57. -$(MAKE) flakecheck
  58. flakepluscheck:
  59. $(FLAKEPLUS) --$(FLAKEPLUSTARGET) "$(PROJ)"
  60. flakeplusdiag:
  61. -$(MAKE) flakepluscheck
  62. flakes: flakediag flakeplusdiag
  63. clean-readme:
  64. -rm -f $(README)
  65. readmecheck:
  66. $(ICONV) -f ascii -t ascii $(README) >/dev/null
  67. $(README):
  68. $(SPHINX2RST) "$(README_SRC)" --ascii > $@
  69. readme: clean-readme $(README) readmecheck
  70. clean-contrib:
  71. -rm -f "$(CONTRIBUTING)"
  72. $(CONTRIBUTING):
  73. $(SPHINX2RST) "$(CONTRIBUTING_SRC)" > $@
  74. contrib: clean-contrib $(CONTRIBUTING)
  75. clean-pyc:
  76. -find . -type f -a \( -name "*.pyc" -o -name "*$$py.class" \) | xargs rm
  77. -find . -type d -name "__pycache__" | xargs rm -r
  78. removepyc: clean-pyc
  79. clean-build:
  80. rm -rf build/ dist/ .eggs/ *.egg-info/ .tox/ .coverage cover/
  81. clean-git:
  82. $(GIT) clean -xdn
  83. clean-git-force:
  84. $(GIT) clean -xdf
  85. test-all: clean-pyc
  86. $(TOX)
  87. test:
  88. $(PYTHON) setup.py test
  89. cov:
  90. $(NOSETESTS) -xv --with-coverage --cover-html --cover-branch
  91. build:
  92. $(PYTHON) setup.py sdist bdist_wheel
  93. distcheck: lint test clean
  94. dist: readme contrib clean-dist build