blob: 6646124e038a6ba671805d0b67883da137994196 [file] [log] [blame]
Filip Pytlounfff50fc2015-06-24 14:57:21 +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
9tests:
10 python ./run_tests.py
11.PHONY: tests
12
13lint:
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
25
26coverage: .coverage
27 python-coverage -r -m
28.PHONY: coverage
29.coverage: $(PYFILES)
30 python-coverage -x setup.py nosetests
31
32docs:
33 $(MAKE) -C doc man html
34
35GH_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
40 @echo " git branch gh-pages-base origin/gh-pages-base" >&2
41 @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)
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}'
51endif
52
53docsclean:
54 $(MAKE) -C doc clean