Makefile 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #
  2. # Makefile for Pygments
  3. # ~~~~~~~~~~~~~~~~~~~~~
  4. #
  5. # Combines scripts for common tasks.
  6. #
  7. # :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
  8. # :license: BSD, see LICENSE for details.
  9. #
  10. PYTHON ?= python
  11. export PYTHONPATH = $(shell echo "$$PYTHONPATH"):$(shell python -c 'import os; print ":".join(os.path.abspath(line.strip()) for line in file("PYTHONPATH"))' 2>/dev/null)
  12. .PHONY: all check clean clean-pyc codetags docs mapfiles \
  13. pylint reindent test test-coverage
  14. all: clean-pyc check test
  15. check:
  16. @$(PYTHON) scripts/detect_missing_analyse_text.py || true
  17. @$(PYTHON) scripts/check_sources.py -i build -i dist -i pygments/lexers/_mapping.py \
  18. -i docs/build -i pygments/formatters/_mapping.py -i pygments/unistring.py \
  19. -i pygments/lexers/_vimbuiltins.py
  20. clean: clean-pyc
  21. -rm -rf build
  22. -rm -f codetags.html
  23. clean-pyc:
  24. find . -name '*.pyc' -exec rm -f {} +
  25. find . -name '*.pyo' -exec rm -f {} +
  26. find . -name '*~' -exec rm -f {} +
  27. codetags:
  28. @$(PYTHON) scripts/find_codetags.py -i tests/examplefiles -i scripts/pylintrc \
  29. -i scripts/find_codetags.py -o codetags.html .
  30. docs: docs/build
  31. docs/build: docs/src/*.txt
  32. $(PYTHON) docs/generate.py html docs/build $?
  33. touch docs/build
  34. mapfiles:
  35. (cd pygments/lexers; $(PYTHON) _mapping.py)
  36. (cd pygments/formatters; $(PYTHON) _mapping.py)
  37. pylint:
  38. @pylint --rcfile scripts/pylintrc pygments
  39. reindent:
  40. @$(PYTHON) scripts/reindent.py -r -B .
  41. test:
  42. @$(PYTHON) tests/run.py $(TESTS)
  43. test-coverage:
  44. @$(PYTHON) tests/run.py -C $(TESTS)