-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathMakefile
More file actions
105 lines (77 loc) · 3.43 KB
/
Makefile
File metadata and controls
105 lines (77 loc) · 3.43 KB
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
TEST_DIR="$(shell pwd)/_build/default/test"
HTML_DIR="$(shell pwd)/_build/default/src/web/www"
SERVER="http://0.0.0.0:8000/"
.PHONY: all deps change-deps setup-instructor setup-student dev dev-helper dev-student fmt watch watch-release release release-student grade echo-html-dir serve serve2 repl test clean setup-zarith
all: dev
# Install native BigInt runtime for zarith_stubs_js to fix WebWorker postMessage serialization.
# The vendored runtime.js uses native JS BigInt (from zarith_stubs_js v0.17.0) which survives
# structured clone, unlike the BigInteger.js library used in older versions.
setup-zarith:
@echo "Installing native BigInt zarith runtime..."
@cp vendor/zarith_native_bigint_runtime.js "$$(opam var lib)/zarith_stubs_js/runtime.js"
deps:
opam repo add archive git+https://github.com/ocaml/opam-repository-archive
opam update
opam install ./hazel.opam.locked --deps-only --with-test --with-doc
npm install
$(MAKE) setup-zarith
change-deps:
opam update
dune build hazel.opam
opam install ./hazel.opam --deps-only --with-test --with-doc
opam lock .
sed -i'.old' '/host-/d' hazel.opam.locked # remove host- lines which are arch-specific. Not using -i '' because of portability issues https://stackoverflow.com/questions/4247068/sed-command-with-i-option-failing-on-mac-but-works-on-linux
setup-instructor:
cp src/web/exercises/settings/ExerciseSettings_instructor.re src/web/exercises/settings/ExerciseSettings.re
setup-student:
cp src/web/exercises/settings/ExerciseSettings_student.re src/web/exercises/settings/ExerciseSettings.re
dev-helper: setup-zarith
dune fmt --auto-promote || true
dune build @ocaml-index @src/fmt --auto-promote src --profile dev
dev: setup-instructor dev-helper
dev-student: setup-student dev-helper
fmt:
dune fmt --auto-promote
watch: setup-instructor setup-zarith
dune build @ocaml-index @src/fmt --auto-promote src --profile dev --watch
watch-release: setup-instructor setup-zarith
dune build @src/fmt --auto-promote src --profile release --watch
release: setup-instructor setup-zarith
dune build @src/fmt --auto-promote src --profile release
release-student: setup-student setup-zarith
dune build @src/fmt --auto-promote src --profile dev # Uses dev profile for performance reasons. It may be worth it to retest since the ocaml upgrade
grade:
ifndef SUBMISSION
$(error Usage: make grade SUBMISSION=<path to submission json>)
endif
python3 src/grading/grade/grade_individual.py $(SUBMISSION) .
echo-html-dir:
@echo $(HTML_DIR)
serve:
cd $(HTML_DIR); python3 -m http.server 8000 --bind 0.0.0.0
hot:
npx vite
serve2:
cd $(HTML_DIR); python3 -m http.server 8001 --bind 0.0.0.0
repl:
dune utop src/haz3lcore
test:
dune fmt --auto-promote || true
dune build @ocaml-index @src/fmt @test/fmt --auto-promote src test --profile dev
node --stack-size=8192 --require $(TEST_DIR)/idb_stub.js $(TEST_DIR)/haz3ltest.bc.js
test-quick:
dune build @ocaml-index @src/fmt @test/fmt --auto-promote src test --profile dev
node --stack-size=8192 --require $(TEST_DIR)/idb_stub.js $(TEST_DIR)/haz3ltest.bc.js -q
watch-test:
dune build @ocaml-index @fmt @runtest @default --profile dev --auto-promote --watch
coverage:
dune build @src/fmt @test/fmt --auto-promote src test --profile dev
dune runtest --instrument-with bisect_ppx --force
bisect-ppx-report summary
ci: setup-zarith
dune build --profile dev
dune runtest --instrument-with bisect_ppx --force
generate-coverage-html:
bisect-ppx-report html
clean:
dune clean