martin f. krafft | bea29d1 | 2013-07-05 08:35:19 +0200 | [diff] [blame] | 1 | # |
| 2 | # This file is part of reclass (http://github.com/madduck/reclass) |
| 3 | # |
| 4 | # Copyright © 2007–13 martin f. krafft <madduck@madduck.net> |
| 5 | # Released under the terms of the Artistic Licence 2.0 |
| 6 | # |
| 7 | PYFILES = $(shell find -name .git -o -name dist -o -name build -prune -o -name '*.py' -print) |
| 8 | |
martin f. krafft | ce821e0 | 2013-07-06 20:58:04 +0200 | [diff] [blame] | 9 | tests: |
martin f. krafft | 59cf02a | 2013-07-09 15:28:28 +0200 | [diff] [blame] | 10 | python ./run_tests.py |
martin f. krafft | ce821e0 | 2013-07-06 20:58:04 +0200 | [diff] [blame] | 11 | .PHONY: tests |
| 12 | |
martin f. krafft | bea29d1 | 2013-07-05 08:35:19 +0200 | [diff] [blame] | 13 | lint: |
| 14 | @echo pylint --rcfile=.pylintrc $(ARGS) … |
| 15 | @pylint --rcfile=.pylintrc $(ARGS) $(PYFILES) |
| 16 | .PHONY: lint |
| 17 | |
| 18 | lint-errors: ARGS=--errors-only |
| 19 | lint-errors: lint |
| 20 | .PHONY: lint-errors |
| 21 | |
| 22 | lint-report: ARGS=--report=y |
| 23 | lint-report: lint |
| 24 | .PHONY: lint-report |
martin f. krafft | b17a7b7 | 2013-07-05 08:45:35 +0200 | [diff] [blame] | 25 | |
| 26 | coverage: .coverage |
| 27 | python-coverage -r -m |
| 28 | .PHONY: coverage |
| 29 | .coverage: $(PYFILES) |
| 30 | python-coverage -x setup.py nosetests |
martin f. krafft | 8acd49d | 2013-08-26 21:22:25 +0200 | [diff] [blame] | 31 | |
| 32 | docs: |
| 33 | $(MAKE) -C doc man html |
martin f. krafft | 3276910 | 2013-08-26 21:35:28 +0200 | [diff] [blame] | 34 | |
martin f. krafft | 5c36d29 | 2013-08-27 16:33:10 +0200 | [diff] [blame] | 35 | GH_BRANCH=gh-pages |
| 36 | HTMLDIR=doc/build/html |
| 37 | docspub: |
| 38 | ifeq ($(shell git branch --list $(GH_BRANCH)-base),) |
| 39 | @echo "Please fetch the $(GH_BRANCH)-base branch from Github to be able to publish documentation:" >&2 |
martin f. krafft | 60b769a | 2013-08-28 10:37:17 +0200 | [diff] [blame] | 40 | @echo " git branch gh-pages-base origin/gh-pages-base" >&2 |
martin f. krafft | 5c36d29 | 2013-08-27 16:33:10 +0200 | [diff] [blame] | 41 | @false |
| 42 | else |
| 43 | $(MAKE) docs |
| 44 | git checkout $(GH_BRANCH) || git checkout -b $(GH_BRANCH) $(GH_BRANCH)-base |
| 45 | git reset --hard $(GH_BRANCH)-base |
| 46 | git add $(HTMLDIR) |
martin f. krafft | 3276910 | 2013-08-26 21:35:28 +0200 | [diff] [blame] | 47 | git mv $(HTMLDIR)/* . |
martin f. krafft | 5c36d29 | 2013-08-27 16:33:10 +0200 | [diff] [blame] | 48 | git commit -m'Webpage update' |
| 49 | git push -f $(shell git config --get branch.$(GH_BRANCH)-base.remote) $(GH_BRANCH) |
martin f. krafft | 3276910 | 2013-08-26 21:35:28 +0200 | [diff] [blame] | 50 | git checkout '@{-1}' |
martin f. krafft | 5c36d29 | 2013-08-27 16:33:10 +0200 | [diff] [blame] | 51 | endif |
martin f. krafft | 9c6a0f2 | 2013-08-26 22:23:21 +0200 | [diff] [blame] | 52 | |
| 53 | docsclean: |
| 54 | $(MAKE) -C doc clean |