forked from vmiklos/ged2dot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (30 loc) · 1.25 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
SHELL := bash
PYFILES := ged2dot.py inlineize.py test/test.py libreoffice/base.py libreoffice/loader.py libreoffice/importer.py libreoffice/dialog.py
check-type: $(patsubst %.py,%.mypy,$(PYFILES))
check-lint: $(patsubst %.py,%.lint,$(PYFILES))
test.png: test.dot
dot -Tpng -o test.png test.dot
test.svg: test-noinline.svg inlineize.py
./inlineize.py test-noinline.svg test.svg
test-noinline.svg: test.dot
dot -Tsvg -o test-noinline.svg test.dot
test.dot: test.ged ged2dot.py ged2dotrc Makefile
./ged2dot.py > test.dot
%.mypy : %.py Makefile
mypy --python-version 3.5 --strict $< && touch $@
%.lint : %.py Makefile
pylint \
--max-line-length=120 \
--disable=import-error,too-many-instance-attributes,missing-docstring,invalid-name,too-many-branches,too-many-statements,fixme,line-too-long,too-many-arguments,protected-access,too-many-locals \
$< && touch $@
check: check-type check-lint
cd test && PYTHONPATH=$(PWD) ./test.py
pycodestyle $(PYFILES)
clean:
rm -f $(patsubst %.py,%.mypy,$(PYFILES))
# In case ged2dotrc or test.dot is missing, create a copy based on the
# screenshot sample.
test.ged :| test/screenshot.ged
cat test/screenshot.ged > test.ged
ged2dotrc :| test/screenshotrc
sed 's/screenshot.ged/test.ged/' test/screenshotrc > ged2dotrc