-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
65 lines (50 loc) · 2.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
DEBUG_BIN := ./target/debug/generic
STRESS_GC_BIN := ./target/stress_gc/generic
REL_BIN := ./target/release/generic
test_level := chap30_optimization
sources := src/*.rs src/compiler/*.rs Cargo.toml
$(DEBUG_BIN): $(sources)
cargo build
$(STRESS_GC_BIN): $(sources)
cargo build --profile stress_gc --features stress_gc
$(REL_BIN): $(sources)
cargo build --release
.PHONY: cargo-test
cargo-test:
cargo test
setup-dart:
dart pub get --directory=tool
.PHONY: custom-dart-test
custom-dart-test: $(DEBUG_BIN)
dart tool/bin/test.dart clox --interpreter ./$(DEBUG_BIN)
.PHONY: stress-gc-test
stress-gc-test: $(STRESS_GC_BIN)
dart tool/bin/test.dart clox --interpreter ./$(STRESS_GC_BIN)
.PHONY: test
test: cargo-test setup-dart custom-dart-test stress-gc-test
.PHONY: benchmark
benchmark: fib-benchmark more-benchmark
.PHONY: more-benchmark
more-benchmark: $(REL_BIN)
for filename in benchmark/*.gen; do \
echo $$filename; \
filebase=$${filename%.*}; \
hyperfine --reference ".\\target\\release\\generic $${filebase}.gen" --show-output --warmup 1 ".\\reference\\craftinginterpreters\\clox $${filebase}.lox.nom" ".\\reference\\craftinginterpreters\\jlox.bat $${filebase}.lox.nom"; \
done
.PHONY: fib-benchmark
fib-benchmark: $(REL_BIN)
hyperfine --reference ".\\target\release\\generic benchmark\\fib\\fib.gen" --warmup 1 ".\\reference\\craftinginterpreters\\clox benchmark\\fib\\fib.lox.nom" \
"python benchmark\\fib\\fib.py" "ruby benchmark\\fib\\fib.rb" ".\\reference\\craftinginterpreters\\jlox.bat benchmark\\fib\\fib.lox.nom" \
.PHONY: benchmark-ci
benchmark-ci: fib-benchmark-ci more-benchmark-ci
.PHONY: more-benchmark-ci
more-benchmark-ci: $(REL_BIN)
for filename in benchmark/*.gen; do \
echo $$filename; \
filebase=$${filename%.*}; \
hyperfine --show-output --warmup 1 "./target/release/generic $${filebase}.gen" "./reference/craftinginterpreters/clox $${filebase}.lox.nom" "./reference/craftinginterpreters/jlox $${filebase}.lox.nom"; \
done
.PHONY: fib-benchmark-ci
fib-benchmark-ci: $(REL_BIN)
hyperfine --warmup 1 "./target/release/generic benchmark/fib/fib.gen" "./reference/craftinginterpreters/clox benchmark/fib/fib.lox.nom" \
"python benchmark/fib/fib.py" "ruby benchmark/fib/fib.rb" "./reference/craftinginterpreters/jlox benchmark/fib/fib.lox.nom" \