forked from extism/js-pdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (28 loc) · 771 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
.PHONY: cli core fmt clean
.DEFAULT_GOAL := cli
download-wasi-sdk:
sh install-wasi-sdk.sh
install:
cargo install --path crates/cli
cli: core
cd crates/cli && QUICKJS_WASM_SYS_WASI_SDK_PATH="$(CURDIR)/wasi-sdk/" cargo build --release && cd -
core:
cd crates/core \
&& QUICKJS_WASM_SYS_WASI_SDK_PATH="$(CURDIR)/wasi-sdk/" cargo build --release --target=wasm32-wasi \
&& cd -
fmt: fmt-core fmt-cli
fmt-core:
cd crates/core/ \
&& cargo fmt -- --check \
&& cargo clippy --target=wasm32-wasi -- -D warnings \
&& cd -
fmt-cli:
cd crates/cli/ \
&& cargo fmt -- --check \
&& cargo clippy -- -D warnings \
&& cd -
clean: clean-wasi-sdk clean-cargo
clean-cargo:
cargo clean
clean-wasi-sdk:
rm -r wasi-sdk 2> /dev/null || true