-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
74 lines (51 loc) · 1.76 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# simple makefile to simplify repetitive build env management tasks under posix
# allow specifying python version on command line to ease testing with
# different versions, e.g. $ PYTHON=/usr/bin/python3 make test
PYTHON ?= python
PACKAGE = prx
.PHONY: all build_dir clean clean_build clean_coverage clean_inplace clean_sphinxbuild code_analysis code_check dist distclean doc doc_force in inplace inplace_force pdf test test_code test_coverage
all: clean inplace test
build_dir:
-mkdir build
clean:
-$(PYTHON) setup.py clean
make -C doc clean
clean_build: clean_egginfo
-$(PYTHON) setup.py clean --all
clean_coverage:
-rm -rf coverage .coverage
clean_egginfo:
-rm -rf "$(PACKAGE).egg-info"
clean_inplace:
-find . -name '*.py[cdo]' -exec rm {} \;
-find $(PACKAGE) \( -name '*.dll' -o -name '*.so' \) -exec rm {} \;
-find $(PACKAGE) -name '*.html' -exec rm {} \;
code_analysis:
-pylint --output-format colorized --extension-pkg-whitelist=numpy $(PACKAGE)
code_check:
flake8 $(PACKAGE) | grep -v __init__ | grep -v _version
pylint --errors-only --output-format colorized --extension-pkg-whitelist=numpy $(PACKAGE)
dist: clean_egginfo
$(PYTHON) setup.py sdist
distclean: clean_build clean_inplace
make -C doc distclean
doc: inplace
make -C doc html
doc_force: inplace
make -C doc distclean
make -C doc html
in: inplace # just a shortcut
inplace:
$(PYTHON) setup.py build_ext --inplace
inplace_force:
$(PYTHON) setup.py build_ext --inplace --force
pdf:
$(PYTHON) setup.py build_sphinx --fresh-env --builder latex
make -C build/sphinx/latex all-pdf
test: test_code
test_code: inplace
nosetests --nocapture --verbosity=2
test_coverage: inplace clean_coverage
nosetests --nocapture --verbosity=2 --with-coverage
wheel: clean_egginfo
$(PYTHON) setup.py bdist_wheel