-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (26 loc) · 742 Bytes
/
Copy pathMakefile
File metadata and controls
34 lines (26 loc) · 742 Bytes
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
.PHONY: all clean update server debug
.SUFFIXES: .wasm .js .rs .ts
TS_ROOT = ts/
TS_SRC = $(TS_ROOT)src/
TS_LIB = $(TS_ROOT)lib/
TS_DIST = $(TS_ROOT)dist/
TS_MAIN = $(TS_DIST)main.js
RS_SRC = rs/
RS_LIB = $(TS_LIB)libtsc_bg.wasm
TOOLS = tools/
all: $(RS_LIB) $(TS_MAIN)
clean:
(cd $(RS_SRC); cargo clean)
-rm -rf node_modules $(TS_ROOT)node_modules $(TS_LIB) $(TS_DIST)
update:
cargo update
(cd $(TS_ROOT); pnpm update)
debug:
(cd $(RS_SRC); cargo build)
cp target/wasm32-unknown-unknown/debug/libimage.wasm $(RS_LIB)
$(RS_LIB): $(RS_SRC)src/*.rs
(cd $(RS_SRC); wasm-pack build --target web --out-dir ../$(TS_LIB))
$(TS_MAIN): $(RS_LIB) $(TS_SRC)*.ts
(cd $(TS_ROOT); pnpm i; pnpm run build)
server:
(cd $(TS_ROOT); pnpm dev)