forked from flaneur2020/pua-lang
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (31 loc) · 958 Bytes
/
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
.PHONY: setup
setup:
(cd web && yarn)
.PHONY: start
start:
make build_wasm
(cd web && yarn start)
.PHONY: test
test:
cargo test
.PHONY: build_repl
build_repl:
cargo build --release
build_wasm: web/src/pua-lang.wasm
web/src/pua-lang.wasm: target/wasm32-unknown-unknown/tiny/wasm.wasm
if command -v wasm-opt >/dev/null; then \
wasm-opt --strip-debug -Oz -o web/src/pua-lang.wasm target/wasm32-unknown-unknown/tiny/wasm.wasm; \
else \
printf '⚠ %s\n' "wasm-opt (binaryen) not found: binary will be larger than normal." >&2; \
cp target/wasm32-unknown-unknown/tiny/wasm.wasm web/src/pua-lang.wasm; \
fi
target/wasm32-unknown-unknown/tiny/wasm.wasm: FORCE
cargo build --bin wasm -Z unstable-options --profile tiny --target wasm32-unknown-unknown --features=wasm
FORCE:
.PHONY: web_deploy
web_deploy:
make build_wasm
(cd web && yarn --pure-lockfile && yarn deploy)
.PHONY: repl
repl:
cargo run --bin pua-lang --features="binaries"