forked from skoolkid/skoolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
92 lines (75 loc) · 2.43 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
80
81
82
83
84
85
86
87
88
89
90
91
92
NOSETESTS ?= nosetests3
NOSETESTS34 ?= $(HOME)/Python/Python3.4/bin/nosetests
NOSETESTS35 ?= $(HOME)/Python/Python3.5/bin/nosetests
NOSETESTS36 ?= $(HOME)/Python/Python3.6/bin/nosetests
OPTIONS = -d build/html -t
OPTIONS += $(foreach theme,$(THEMES),-T $(theme))
OPTIONS += $(HTML_OPTS)
.PHONY: usage
usage:
@echo "Targets:"
@echo " usage show this help"
@echo " doc build the documentation"
@echo " man build the man pages"
@echo " clean clean the documentation and man pages"
@echo " hh build the Hungry Horace disassembly"
@echo " test[-all] run core/all tests with default Python 3 interpreter"
@echo " test3X[-all] run core/all tests with Python 3.X (4<=X<=6)"
@echo " test-cover run core tests with coverage info"
@echo " release build a SkoolKit release tarball and zip archive"
@echo " tarball build a SkoolKit release tarball"
@echo " deb build a SkoolKit Debian package"
@echo " rpm build a SkoolKit RPM package"
@echo ""
@echo "Variables:"
@echo " THEMES CSS theme(s) to use"
@echo " HTML_OPTS options passed to skool2html.py"
.PHONY: doc
doc:
$(MAKE) -C sphinx html
.PHONY: man
man:
$(MAKE) -C sphinx man
.PHONY: clean
clean:
$(MAKE) -C sphinx clean
.PHONY: hh
hh:
if [ ! -f build/hungry_horace.z80 ]; then ./tap2sna.py -d build @examples/hungry_horace.t2s; fi
./sna2skool.py -c examples/hungry_horace.ctl build/hungry_horace.z80 > build/hungry_horace.skool
./skool2html.py $(OPTIONS) -S build examples/hungry_horace.ref
.PHONY: write-disassembly-tests
write-disassembly-tests:
for t in asm ctl html sft; do \
tools/write-hh-tests.py $$t > tests/test_hh_$$t.py; \
done
.PHONY: remove-disassembly-tests
remove-disassembly-tests:
rm -f tests/test_hh_*.py*
.PHONY: test
test: remove-disassembly-tests
$(NOSETESTS) -w tests
.PHONY: test-all
test-all: write-disassembly-tests
$(NOSETESTS) -w tests
.PHONY: test%
test%: remove-disassembly-tests
$(NOSETESTS$*) -w tests
.PHONY: test%-all
test%-all: write-disassembly-tests
$(NOSETESTS$*) -w tests
.PHONY: test-cover
test-cover: remove-disassembly-tests
$(NOSETESTS) -w tests --with-coverage --cover-package=skoolkit --cover-erase
.PHONY: release
release:
SKOOLKIT_HOME=`pwd` tools/mksktarball
.PHONY: tarball
tarball:
SKOOLKIT_HOME=`pwd` tools/mksktarball -t
.PHONY: deb
deb:
SKOOLKIT_HOME=`pwd` tools/mkskpkg deb
.PHONY: rpm
rpm:
SKOOLKIT_HOME=`pwd` tools/mkskpkg rpm