blob: 6646124e038a6ba671805d0b67883da137994196 [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
martin f. krafft5c36d292013-08-27 16:33:10 +020035GH_BRANCH=gh-pages
36HTMLDIR=doc/build/html
37docspub:
38ifeq ($(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. krafft60b769a2013-08-28 10:37:17 +020040 @echo " git branch gh-pages-base origin/gh-pages-base" >&2
martin f. krafft5c36d292013-08-27 16:33:10 +020041 @false
42else
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. krafft32769102013-08-26 21:35:28 +020047 git mv $(HTMLDIR)/* .
martin f. krafft5c36d292013-08-27 16:33:10 +020048 git commit -m'Webpage update'
49 git push -f $(shell git config --get branch.$(GH_BRANCH)-base.remote) $(GH_BRANCH)
martin f. krafft32769102013-08-26 21:35:28 +020050 git checkout '@{-1}'
martin f. krafft5c36d292013-08-27 16:33:10 +020051endif
martin f. krafft9c6a0f22013-08-26 22:23:21 +020052
53docsclean:
54 $(MAKE) -C doc clean