| Filip Pytloun | fff50fc | 2015-06-24 14:57:21 +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 |  | 
|  | 9 | tests: | 
|  | 10 | python ./run_tests.py | 
|  | 11 | .PHONY: tests | 
|  | 12 |  | 
|  | 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 | 
|  | 25 |  | 
|  | 26 | coverage: .coverage | 
|  | 27 | python-coverage -r -m | 
|  | 28 | .PHONY: coverage | 
|  | 29 | .coverage: $(PYFILES) | 
|  | 30 | python-coverage -x setup.py nosetests | 
|  | 31 |  | 
|  | 32 | docs: | 
|  | 33 | $(MAKE) -C doc man html | 
|  | 34 |  | 
|  | 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 | 
|  | 40 | @echo "  git branch gh-pages-base origin/gh-pages-base" >&2 | 
|  | 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) | 
|  | 47 | git mv $(HTMLDIR)/* . | 
|  | 48 | git commit -m'Webpage update' | 
|  | 49 | git push -f $(shell git config --get branch.$(GH_BRANCH)-base.remote) $(GH_BRANCH) | 
|  | 50 | git checkout '@{-1}' | 
|  | 51 | endif | 
|  | 52 |  | 
|  | 53 | docsclean: | 
|  | 54 | $(MAKE) -C doc clean |