-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
35 lines (26 loc) · 1003 Bytes
/
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
.PHONY: all clean check check-relaxed
PYTHONFILES = $(wildcard *.py)
FLAKE8 = flake8
FLAKE8_OPTIONS = --exit-zero
all:
@echo 'Valid make targets:'
@echo ' check - Analyze code with pyflakes and ${FLAKE8}'
@echo ' check-relaxed - Analyze code with relaxed setting, ignoring some issues'
@echo ' states-doc - Create documentation for update state machine'
@echo ' clean - Remove all generated files'
check:
@for f in $$(grep -lr --include='*.py' 'import doctest'); do python3 -m $$(echo $$f | tr '/' '.' | sed 's/\.py$///'); done
python3 -m pyflakes $(PYTHONFILES)
python3 -m ${FLAKE8} ${FLAKE8_OPTIONS} $(PYTHONFILES)
check-relaxed:
python3 -m pyflakes $(PYTHONFILES)
python3 -m ${FLAKE8} ${FLAKE8_OPTIONS} --ignore=E501,W504 $(PYTHONFILES)
states-doc: states.html states.pdf
states.html: states.md
markdown <$< >$@
states.pdf: states.dot
dot -Tpdf <$< >$@
clean:
rm -rf __pycache__
rm -f GPATH GRTAGS GTAGS tags types_py.taghl
rm -f states.html states.pdf