-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
57 lines (42 loc) · 1.65 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
.PHONY: all clean setup lib wasm publish publishweb format checknostd check test testunit testmidi testwasm testweb
all:
$(error You must specify one of the following targets: clean setup docs lib wasm publish publishweb format checknostd check test testunit testwasm testweb)
clean:
cd ensure_no_std && cargo clean && rm -rf Cargo.lock
cargo clean
@rm -rf pkg target*
setup:
rustup target add wasm32-unknown-unknown x86_64-unknown-none
cargo install wasm-pack
docs:
RUSTDOCFLAGS="--extend-css amm_sdk/assets/docs.css" cargo doc --workspace --no-deps --release --lib --exclude amm_internal --exclude amm_macros
echo "<meta http-equiv=\"refresh\" content=\"0;url=amm_sdk/index.html\" />" > target/doc/index.html
cp -r amm_sdk/assets/* target/doc/amm_sdk/
mv target/doc/amm_sdk/fonts target/doc/
lib:
cargo build --lib --release
wasm:
wasm-pack build --target nodejs
# wasm-opt -Os(or -Oz) add_bg.wasm -o add.wasm
publish:
cargo publish -p amm_internal
cargo publish -p amm_macros
cargo publish -p amm_sdk
publishweb: wasm
wasm-pack publish
format:
cargo fmt
checknostd:
cd ensure_no_std && cargo build --target x86_64-unknown-none
check:
cargo clippy -- -W clippy::all -W clippy::correctness -W clippy::suspicious -W clippy::complexity -W clippy::perf -W clippy::style -W clippy::pedantic -A clippy::module_name_repetitions -A clippy::module_inception -A clippy::too_many_lines -D warnings
test:
cargo run --release --bin test
testunit:
cargo test -- --nocapture
testwasm:
wasm-pack test --node
testweb:
wasm-pack build --target --web
cp tests/wasm_index.html pkg/index.html
npx live-server ./pkg