Debian Codegraph @

Makefile

raw
1 # vim: ts=4: sw=4: noet
2
3 package = contrib/package.sh
4 unittest = contrib/unittest.sh
5 subdirs = docs
6
7 define usage
8
9 The following make targets are available:
10
11 clean Cleanup build directories.
12 dist Build distribution files.
13 fla Run flake8.
14 fmt Format Python source code.
15 help Show this text.
16 pypi Upload distribution files to PyPI.
17 shc Shell script care.
18 stest Run sandboxed Python tests (disables network tests).
19 test Run all Python tests and generate coverage report.
20
21 endef
22
23 .PHONY: clean fla help pypi shc stest subdirs test
24
25 subdirs: $(subdirs)
26
27 $(subdirs):
28 make -C $@
29
30 help:
31 $(info $(usage))
32 @exit 0
33
34 clean:
35 find tmp -type f -delete
36 $(package) clean
37
38 dist:
39 $(package) dist
40
41 pypi:
42 @echo "# Run this command to upload:\n$(package) pypi"
43
44 stest: fla
45 env NETWORK_TESTS=0 $(unittest)
46
47 test: fla
48 env NETWORK_TESTS=1 $(unittest) coverage
49
50 shc:
51 shcare contrib/*.sh
52
53 fmt:
54 black -l 120 src tests
55
56 fla: fmt
57 flake8 src tests --config=.flake8