-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
79 lines (61 loc) · 1.77 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
75
76
77
78
79
GV:=fdp
GITK:=gitk
CTAGS:=ctags
PY:=python3
PIP:=pip
help:
@echo "make check-depends"
@echo " Check whether all required dependencies are present"
@echo "make install"
@echo " Install the application"
@echo "make install-editable"
@echo " Install the application using links to this source"
@echo " directory."
@echo "make uninstall"
@echo " Delete installed files"
@echo "make test-python"
@echo " Execute tests, which create tests/*.actual.gv files"
@echo "make test-images"
@echo " Generate PNGs for all tests/*.gv files."
@echo " Useful if tests fail, to check differences visually."
@echo "make test-update-expected"
@echo " Use tests/*.actual.gv as future tests/*.expected.gv."
@echo " Compare actual and expected PNGs before you use this."
@echo "make lint"
@echo " Run lint tool"
check-depends:
@echo "Checking dependencies"
@which $(GITK)
@git version
@$(GV) -V
@$(CTAGS) --version
@$(PY) --version
test: test-python
test-python: clean-test-python
$(PY) -m tests.test_classdiff
clean-test-python:
rm -f tests/*.actual.gv
tests/%.png: tests/%.gv
$(GV) -Tpng -o $@ $<
test-images: clean-test-images $(patsubst %.gv,%.png,$(wildcard tests/*.gv))
clean-test-images:
rm -f tests/*.png
test-update-expected: tests/*.actual.gv
$(foreach file,$^,cp $(file) $(patsubst %.actual.gv,%.expected.gv,$(file));)
install:
$(PIP) install .
install-editable:
$(PIP) install -e .
rm -f /usr/bin/gitk-cl
ln -s $$(readlink -f gitk-cl) /usr/bin/gitk-cl
install-from-pypi:
$(PIP) install gitk-class-diagram
uninstall:
$(PIP) uninstall gitk-class-diagram
lint:
flake8
package:
$(PY) setup.py sdist bdist_wheel
clean-setup:
$(PY) setup.py clean
.PHONY: check-depends test-python clean-test-python test-images clean-test-images install uninstall lint package clean-setup