-
Notifications
You must be signed in to change notification settings - Fork 892
/
Makefile
40 lines (31 loc) · 942 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
39
40
all: check build test
CARGO_BUILD_TARGET?=wasm32-unknown-unknown
test: fmt
cargo test
build: fmt
cargo build --target $(CARGO_BUILD_TARGET) --no-default-features --release
cd target/$(CARGO_BUILD_TARGET)/release/ && \
for i in *.wasm ; do \
ls -l "$$i"; \
done
build-optimized: fmt
CARGO_TARGET_DIR=target-tiny cargo +nightly build --target $(CARGO_BUILD_TARGET) --release \
-Z build-std=std,panic_abort \
-Z build-std-features=panic_immediate_abort
cd target-tiny/$(CARGO_BUILD_TARGET)/release/ && \
for i in *.wasm ; do \
wasm-opt -Oz "$$i" -o "$$i.tmp" && mv "$$i.tmp" "$$i"; \
ls -l "$$i"; \
done
build-docker:
docker build . --tag soroban-preview:10
check: fmt
cargo clippy --all-targets
cargo clippy --release --target $(CARGO_BUILD_TARGET)
watch:
cargo watch --clear --watch-when-idle --shell '$(MAKE)'
fmt:
cargo fmt --all
clean:
cargo clean
CARGO_TARGET_DIR=target-tiny cargo +nightly clean