blob: 1b01e241b799eaef6540c6ade715e2c3497ba123 [file] [log] [blame]
martin f. krafftbea29d12013-07-05 08:35:19 +02001#
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#
7PYFILES = $(shell find -name .git -o -name dist -o -name build -prune -o -name '*.py' -print)
8
martin f. krafftce821e02013-07-06 20:58:04 +02009tests:
martin f. krafft59cf02a2013-07-09 15:28:28 +020010 python ./run_tests.py
martin f. krafftce821e02013-07-06 20:58:04 +020011.PHONY: tests
12
martin f. krafftbea29d12013-07-05 08:35:19 +020013lint:
14 @echo pylint --rcfile=.pylintrc $(ARGS)
15 @pylint --rcfile=.pylintrc $(ARGS) $(PYFILES)
16.PHONY: lint
17
18lint-errors: ARGS=--errors-only
19lint-errors: lint
20.PHONY: lint-errors
21
22lint-report: ARGS=--report=y
23lint-report: lint
24.PHONY: lint-report
martin f. krafftb17a7b72013-07-05 08:45:35 +020025
26coverage: .coverage
27 python-coverage -r -m
28.PHONY: coverage
29.coverage: $(PYFILES)
30 python-coverage -x setup.py nosetests
martin f. krafft8acd49d2013-08-26 21:22:25 +020031
32docs:
33 $(MAKE) -C doc man html
martin f. krafft32769102013-08-26 21:35:28 +020034
35docspub: BRANCH=gh-pages
36docspub: HTMLDIR=doc/build/html
37docspub: docs
38 git checkout $(BRANCH)
39 git rm -rf . || :
40 echo '/doc/build/html/.buildinfo' > .gitignore
41 git add $(HTMLDIR) .gitignore
42 git mv $(HTMLDIR)/* .
43 if git commit -m'Webpage update' -s; then \
44 git push $(shell git config --get branch.$(BRANCH).remote) $(BRANCH); \
45 fi
46 git checkout '@{-1}'