-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (32 loc) · 1.2 KB
/
Makefile
File metadata and controls
39 lines (32 loc) · 1.2 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
all: best
# With rule options in src/dune. Disable inlining to get a good size but always working JS.
best:
@dune build @@default
@cp _build/install/default/bin/comby.js js
@sed -i .orig "s|steps=\[0,20|steps=\[0,1|" js/comby.js
@sed -i .orig "s|max_steps=20|max_steps=1|" js/comby.js
@rm js/comby.js.orig
@du -h js/comby.js
# Using dune for separate compiliation. Produces a bigger final JS file, but always works.
build:
@dune build ./src/comby.bc.js --profile dev
@cp ./_build/default/src/comby.bc.js js/comby.debug.js
@du -h js/comby.debug.js
@sed -i .orig "s|steps=\[0,20|steps=\[0,1|" js/comby.debug.js
@sed -i .orig "s|max_steps=20|max_steps=1|" js/comby.debug.js
@rm js/comby.debug.js.orig
# Uses dune direct complation. Enables inlining, which undos tramplining and the examples don't work.
release:
@dune build ./src/comby.bc.js --profile release
@cp ./_build/default/src/comby.bc.js js/comby.opt.js
@du -h js/comby.opt.js
@sed -i .orig "s|steps=\[0,20|steps=\[0,1|" js/comby.opt.js
@sed -i .orig "s|max_steps=20|max_steps=1|" js/comby.opt.js
@rm js/comby.opt.js.orig
test:
@cd test && ./test.sh
clean:
@dune clean
promote:
@dune promote
.PHONY: all build release test clean promote test