-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (45 loc) · 1.87 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
CRAFTING_INTERPRETERS ?= ../craftinginterpreters
DEBUG_BIN := target/debug/clox-rs
test_level := chap30_optimization
sources := Cargo.toml $(shell find src/ -type f)
web_sources := web/Cargo.toml $(shell find web/src/ -type f) $(shell find web/src/ -type f -name '*.html' -name '*.css' -name '*.js')
$(DEBUG_BIN): $(sources)
cargo build
.PHONY: cargo-test
cargo-test:
cargo test
.PHONY: craftinginterpreters-test
craftinginterpreters-test: $(DEBUG_BIN)
$(eval home := $(shell pwd))
cd $(CRAFTING_INTERPRETERS) && \
dart tool/bin/test.dart $(test_level) --interpreter $(home)/$(DEBUG_BIN) --arguments --std
.PHONY: craftinginterpreters-test-stress-gc
craftinginterpreters-test-stress-gc: $(DEBUG_BIN)
$(eval home := $(shell pwd))
cd $(CRAFTING_INTERPRETERS) && \
dart tool/bin/test.dart $(test_level) --interpreter $(home)/$(DEBUG_BIN) --arguments --std --arguments --stress-gc
.PHONY: craftinginterpreters-test-both
craftinginterpreters-test-both: craftinginterpreters-test craftinginterpreters-test-stress-gc
.PHONY: custom-dart-test
custom-dart-test: $(DEBUG_BIN)
dart $(CRAFTING_INTERPRETERS)/tool/bin/test.dart clox --interpreter $(DEBUG_BIN)
.PHONY: custom-dart-test-stress-gc
custom-dart-test-stress-gc: $(DEBUG_BIN)
dart $(CRAFTING_INTERPRETERS)/tool/bin/test.dart clox --interpreter $(DEBUG_BIN) --arguments --stress-gc
.PHONY: custom-dart-test-both
custom-dart-test-both: custom-dart-test custom-dart-test-stress-gc
.PHONY: test
test: cargo-test craftinginterpreters-test-both custom-dart-test-both
.PHONY: web
web: $(sources) $(web_sources) web/help/NOTES.html web/help/preface.html
cd web && trunk build --release --public-url /clox-rs/
git add web/dist
.PHONY: web-dev
web-dev: web/help/NOTES.html web/help/preface.html
cd web && trunk serve --open
web/help/NOTES.html: NOTES.md
cmark $< > $@
git add $@
web/help/preface.html: web/help/preface.md
cmark $< > $@
git add $@