-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathMakefile
68 lines (55 loc) · 1.23 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
66
67
68
LAM_EXE=lam
.PHONY: build
build: build.wasm build.web
cargo build
.PHONY: build.wasm
build.wasm:
cargo build --target wasm32-wasi --package lam-rts-wasm
.PHONY: build.web
build.web:
wasm-pack build \
--dev \
--target web \
--no-typescript \
./lib/lam-rts-web \
-- --package lam-rts-web
cp ./lib/lam-rts-web/pkg/lam_rts_web.js ./lib/lam-compiler/src/index.js
.PHONY: manual
manual:
mdbook build --dest-dir ../docs/manual ./manual
.PHONY: test
test:
cargo test
.PHONY: release.win
release.win: LAM_EXE=lam.exe
release.win: release
.PHONY: release
release: release.wasm release.web
cargo build --release
tar czf release.tar.gz -C ./target/release/ $(LAM_EXE)
.PHONY: release.wasm
release.wasm:
cargo build --release --target wasm32-wasi --package lam-rts-wasm
.PHONY: release.web
release.web:
wasm-pack build \
--release \
--target web \
--no-typescript \
./lib/lam-rts-web \
-- --package lam-rts-web
cp ./lib/lam-rts-web/pkg/lam_rts_web.js ./lib/lam-compiler/src/index.js
.PHONY: install
install: release
cargo install --path ./lib/lam-bin
.PHONY: setup
setup:
cargo install wasm-pack
rustup target add wasm32-wasi
rustup target add wasm32-unknown-unknown
.PHONY: clean
clean:
cargo clean
.PHONY: fmt
fmt:
cargo fmt