forked from stellar/soroban-example-dapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (29 loc) · 887 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
all: check build test
export RUSTFLAGS=-Dwarnings -Dclippy::all -Dclippy::pedantic
test: fmt
cargo test
build: fmt
cargo build --target wasm32-unknown-unknown --release
cd target/wasm32-unknown-unknown/release/ && \
for i in *.wasm ; do \
ls -l "$$i"; \
done
build-optimized: fmt
CARGO_TARGET_DIR=target-tiny cargo +nightly build --target wasm32-unknown-unknown --release \
-Z build-std=std,panic_abort \
-Z build-std-features=panic_immediate_abort
cd target-tiny/wasm32-unknown-unknown/release/ && \
for i in *.wasm ; do \
wasm-opt -Oz "$$i" -o "$$i.tmp" && mv "$$i.tmp" "$$i"; \
ls -l "$$i"; \
done
check: fmt
cargo clippy --all-targets
cargo clippy --release --target wasm32-unknown-unknown
watch:
cargo watch --clear --watch-when-idle --shell '$(MAKE)'
fmt:
cargo fmt --all
clean:
cargo clean
CARGO_TARGET_DIR=target-tiny cargo +nightly clean