|
| 1 | +# A GNU Makefile to run various tasks - compatibility for us old-timers. |
| 2 | + |
| 3 | +# Note: This makefile include remake-style target comments. |
| 4 | +# These comments before the targets start with #: |
| 5 | +# remake --tasks to shows the targets and the comments |
| 6 | + |
| 7 | +GIT2CL ?= admin-tools/git2cl |
| 8 | +PYTHON ?= python3 |
| 9 | +PIP ?= pip3 |
| 10 | +RM ?= rm |
| 11 | + |
| 12 | +.PHONY: all build \ |
| 13 | + check clean \ |
| 14 | + develop dist doc doc-data \ |
| 15 | + pypi-setup \ |
| 16 | + pytest \ |
| 17 | + rmChangeLog \ |
| 18 | + test |
| 19 | + |
| 20 | +#: Default target - same as "develop" |
| 21 | +all: develop |
| 22 | + |
| 23 | +#: build everything needed to install |
| 24 | +build: pypi-setup |
| 25 | + $(PYTHON) ./setup.py build |
| 26 | + |
| 27 | +#: Check Python version, and install PyPI dependencies |
| 28 | +pypi-setup: |
| 29 | + $(PIP) install -e . |
| 30 | + |
| 31 | +#: Set up to run from the source tree |
| 32 | +develop: pypi-setup |
| 33 | + |
| 34 | +#: Install pymathics.graph |
| 35 | +install: pypi-setup |
| 36 | + $(PYTHON) setup.py install |
| 37 | + |
| 38 | +# Run tests |
| 39 | +check: pytest doctest |
| 40 | + |
| 41 | +#: Remove derived files |
| 42 | +clean: clean-pyc |
| 43 | + |
| 44 | +#: Remove old PYC files |
| 45 | +clean-pyc: |
| 46 | + @find . -name "*.pyc" -type f -delete |
| 47 | + |
| 48 | +#: Run py.test tests. Use environment variable "o" for pytest options |
| 49 | +pytest: |
| 50 | + py.test test $o |
| 51 | + |
| 52 | + |
| 53 | +# #: Create data that is used to in Django docs and to build TeX PDF |
| 54 | +# doc-data mathics/doc/tex/data: mathics/builtin/*.py mathics/doc/documentation/*.mdoc mathics/doc/documentation/images/* |
| 55 | +# $(PYTHON) mathics/test.py -ot -k |
| 56 | + |
| 57 | +#: Run tests that appear in docstring in the code. |
| 58 | +doctest: |
| 59 | + $(PYTHON) mathics/test.py $o |
| 60 | + |
| 61 | +# #: Make Mathics PDF manual |
| 62 | +# doc mathics.pdf: mathics/doc/tex/data |
| 63 | +# (cd mathics/doc/tex && $(MAKE) mathics.pdf) |
| 64 | + |
| 65 | +#: Remove ChangeLog |
| 66 | +rmChangeLog: |
| 67 | + $(RM) ChangeLog || true |
| 68 | + |
| 69 | +#: Create a ChangeLog from git via git log and git2cl |
| 70 | +ChangeLog: rmChangeLog |
| 71 | + git log --pretty --numstat --summary | $(GIT2CL) >$@ |
0 commit comments