forked from Devdave-0x/stellar-trust-escrow
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
26 lines (21 loc) · 848 Bytes
/
Copy pathMakefile
File metadata and controls
26 lines (21 loc) · 848 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
.PHONY: bench coverage build build-optimized wasm-size
bench:
cargo bench -p escrow_contract
coverage:
cargo tarpaulin --config tarpaulin.toml --out Html --out Xml --output-dir target/tarpaulin
build:
cargo build --target wasm32-unknown-unknown --release
build-optimized: build
@mkdir -p target/wasm32-unknown-unknown/optimized
@for wasm in target/wasm32-unknown-unknown/release/*.wasm; do \
name=$$(basename $$wasm); \
wasm-opt -Oz "$$wasm" -o "target/wasm32-unknown-unknown/optimized/$$name"; \
echo "$$name: $$(wc -c < "target/wasm32-unknown-unknown/optimized/$$name") bytes"; \
done
wasm-size: build
@echo "--- Compiled WASM sizes ---"
@for wasm in target/wasm32-unknown-unknown/release/*.wasm; do \
name=$$(basename $$wasm); \
size=$$(wc -c < "$$wasm"); \
echo "$$name: $$size bytes ($$(( size / 1024 )) KB)"; \
done