-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
233 lines (181 loc) · 8.29 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
# Adapted from: http://www.greghendershott.com/2017/04/racket-makefiles.html
SHELL=/bin/bash
PACKAGE-NAME=qi
DEPS-FLAGS=--check-pkg-deps --unused-pkg-deps
help:
@echo "Run common development actions."
@echo
@echo " Usage: make <target>"
@echo " where <target> is one of:"
@echo
@echo "help - show this menu"
@echo "install - install package along with dependencies"
@echo "install-sdk - install the SDK which includes developer tools"
@echo "remove - remove package"
@echo "remove-sdk - remove SDK; this will not remove SDK dependencies"
@echo "build - Compile libraries"
@echo "build-docs - Build docs"
@echo "build-standalone-docs - Build self-contained docs that could be hosted somewhere"
@echo "build-all - Compile libraries, build docs, and check dependencies"
@echo "clean - remove all build artifacts"
@echo "clean-sdk - remove all build artifacts in SDK paths"
@echo "check-deps - check dependencies"
@echo "test - run tests"
@echo "test-with-errortrace - run tests with error tracing"
@echo "errortrace - alias for test-with-errortrace"
@echo "test-<module> - Run tests for <module>"
@echo "errortrace-<module> - Run tests for <module> with error tracing"
@echo "Modules:"
@echo " flow"
@echo " on"
@echo " threading"
@echo " switch"
@echo " definitions"
@echo " macro"
@echo " util"
@echo " expander"
@echo " compiler"
@echo " probe"
@echo " Note: As probe is not in qi-lib, it isn't part of"
@echo " the tests run in the 'test' target."
@echo "cover - Run test coverage checker and view report"
@echo "cover-coveralls - Run test coverage and upload to Coveralls"
@echo "coverage-check - Run test coverage checker"
@echo "coverage-report - View test coverage report"
@echo "docs - view docs in a browser"
@echo "new-benchmarks - Run new benchmarks and generate an HTML report"
@echo "profile - Get a performance profile of any Racket command"
@echo "benchmark - Run comprehensive performance benchmarks"
@echo "benchmark-competitive - Run competitive benchmarks"
@echo "benchmark-local - Run benchmarks for individual Qi forms"
@echo "benchmark-nonlocal - Run nonlocal benchmarks exercising many components at once"
@echo "benchmark-selected-forms - Run benchmarks for Qi forms by name (command only)"
@echo "performance-report - Run benchmarks for Qi forms and produce results for use in CI and for measuring regression"
@echo " For use in regression: make performance-report > /path/to/before.json"
@echo "performance-regression-report - Run benchmarks for Qi forms against a reference report."
@echo " make performance-regression-report REF=/path/to/before.json"
# Primarily for use by CI.
# Installs dependencies as well as linking this as a package.
install:
raco pkg install --deps search-auto --link $(PWD)/$(PACKAGE-NAME)-{lib,test,doc,probe} $(PWD)/$(PACKAGE-NAME)
install-sdk:
raco pkg install --deps search-auto --link $(PWD)/$(PACKAGE-NAME)-sdk
remove:
raco pkg remove $(PACKAGE-NAME)-{lib,test,doc,probe} $(PACKAGE-NAME)
remove-sdk:
raco pkg remove $(PACKAGE-NAME)-sdk
# Primarily for day-to-day dev.
# Build libraries from source.
build:
raco setup --no-docs --pkgs $(PACKAGE-NAME)-lib
# Primarily for day-to-day dev.
# Build docs (if any).
build-docs:
raco setup --no-launcher --no-foreign-libs --no-info-domain --no-pkg-deps \
--no-install --no-post-install --pkgs $(PACKAGE-NAME)-doc
# Primarily for day-to-day dev.
# Build libraries from source, build docs (if any), and check dependencies.
build-all:
raco setup $(DEPS-FLAGS) --pkgs $(PACKAGE-NAME)-{lib,test,doc,probe} $(PACKAGE-NAME)
# Primarily for CI, for building backup docs that could be used in case
# the main docs at docs.racket-lang.org become unavailable.
build-standalone-docs:
scribble +m --redirect-main http://pkg-build.racket-lang.org/doc/ --htmls --dest ./docs ./qi-doc/scribblings/qi.scrbl
# Note: Each collection's info.rkt can say what to clean, for example
# (define clean '("compiled" "doc" "doc/<collect>")) to clean
# generated docs, too.
clean:
raco setup --fast-clean --pkgs $(PACKAGE-NAME)-{lib,test,doc,probe}
clean-sdk:
raco setup --fast-clean --pkgs $(PACKAGE-NAME)-sdk
# Primarily for use by CI, after make install -- since that already
# does the equivalent of make setup, this tries to do as little as
# possible except checking deps.
check-deps:
raco setup --no-docs $(DEPS-FLAGS) $(PACKAGE-NAME)
# Suitable for both day-to-day dev and CI
# Note: we don't test qi-doc since there aren't any tests there atm
# and it also seems to make things extremely slow to include it.
test:
raco test -exp $(PACKAGE-NAME)-{lib,test,probe}
test-flow:
racket -y $(PACKAGE-NAME)-test/tests/flow.rkt
test-on:
racket -y $(PACKAGE-NAME)-test/tests/on.rkt
test-threading:
racket -y $(PACKAGE-NAME)-test/tests/threading.rkt
test-switch:
racket -y $(PACKAGE-NAME)-test/tests/switch.rkt
test-definitions:
racket -y $(PACKAGE-NAME)-test/tests/definitions.rkt
test-macro:
racket -y $(PACKAGE-NAME)-test/tests/macro.rkt
test-util:
racket -y $(PACKAGE-NAME)-test/tests/util.rkt
test-expander:
racket -y $(PACKAGE-NAME)-test/tests/expander.rkt
test-compiler:
racket -y $(PACKAGE-NAME)-test/tests/compiler.rkt
test-probe:
raco test -exp $(PACKAGE-NAME)-probe
test-with-errortrace:
racket -l errortrace -l racket -e '(require (submod "$(PACKAGE-NAME)-test/tests/qi.rkt" test))'
errortrace: test-with-errortrace
errortrace-flow:
racket -l errortrace -l racket -e '(require (submod "$(PACKAGE-NAME)-test/tests/flow.rkt" main))'
errortrace-on:
racket -l errortrace -l racket -e '(require (submod "$(PACKAGE-NAME)-test/tests/on.rkt" main))'
errortrace-threading:
racket -l errortrace -l racket -e '(require (submod "$(PACKAGE-NAME)-test/tests/threading.rkt" main))'
errortrace-switch:
racket -l errortrace -l racket -e '(require (submod "$(PACKAGE-NAME)-test/tests/switch.rkt" main))'
errortrace-definitions:
racket -l errortrace -l racket -e '(require (submod "$(PACKAGE-NAME)-test/tests/definitions.rkt" main))'
errortrace-macro:
racket -l errortrace -l racket -e '(require (submod "$(PACKAGE-NAME)-test/tests/macro.rkt" main))'
errortrace-util:
racket -l errortrace -l racket -e '(require (submod "$(PACKAGE-NAME)-test/tests/util.rkt" main))'
errortrace-probe:
racket -l errortrace -l racket -e '(require (submod "$(PACKAGE-NAME)-probe/tests/qi-probe.rkt" test))'
docs:
raco docs $(PACKAGE-NAME)
coverage-check:
raco cover -b -d ./coverage -p $(PACKAGE-NAME)-{lib,test}
coverage-report:
open coverage/index.html
cover: coverage-check coverage-report
cover-coveralls:
raco cover -b -f coveralls -p $(PACKAGE-NAME)-{lib,test}
profile:
@echo "To get a performance profile:"
@echo " raco profile --total <any Racket command, including arguments>"
@echo "Example:"
@echo " raco profile --total qi-sdk/benchmarks/nonlocal/report-competitive.rkt -s filter-map"
@echo "For more options:"
@echo " raco profile --help"
new-benchmarks:
cd qi-sdk/benchmarks/competitive && \
scribble \
++convert svg \
++arg -p \
++arg github \
--html \
--dest results \
--dest-name index.html \
report.scrbl
benchmark-local:
racket $(PACKAGE-NAME)-sdk/benchmarks/local/report.rkt
benchmark-loading:
racket $(PACKAGE-NAME)-sdk/benchmarks/loading/report.rkt
benchmark-selected-forms:
@echo "Use 'racket $(PACKAGE-NAME)-sdk/benchmarks/local/report.rkt' directly, with -s form-name for each form."
benchmark-competitive:
cd $(PACKAGE-NAME)-sdk/benchmarks/nonlocal; racket report-competitive.rkt
benchmark-nonlocal:
cd $(PACKAGE-NAME)-sdk/benchmarks/nonlocal; racket report-intrinsic.rkt -l qi
benchmark: benchmark-local benchmark-nonlocal benchmark-loading
performance-report:
@racket $(PACKAGE-NAME)-sdk/benchmarks/report.rkt -f json
performance-regression-report:
@racket $(PACKAGE-NAME)-sdk/benchmarks/report.rkt -r $(REF)
.PHONY: help install remove build build-docs build-all clean check-deps test test-flow test-on test-threading test-switch test-definitions test-macro test-util test-expander test-compiler test-probe test-with-errortrace errortrace errortrace-flow errortrace-on errortrace-threading errortrace-switch errortrace-definitions errortrace-macro errortrace-util errortrace-probe docs cover coverage-check coverage-report cover-coveralls profile new-benchmarks benchmark-local benchmark-loading benchmark-selected-forms benchmark-competitive benchmark-nonlocal benchmark performance-report performance-regression-report