forked from casper-ecosystem/cep18
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (34 loc) · 1.28 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
PINNED_TOOLCHAIN := $(shell cat rust-toolchain)
prepare:
rustup target add wasm32-unknown-unknown
rustup component add clippy --toolchain ${PINNED_TOOLCHAIN}
rustup component add rustfmt --toolchain ${PINNED_TOOLCHAIN}
.PHONY: build-contract
build-contract:
cargo build --release --target wasm32-unknown-unknown -p cep18
cargo build --release --target wasm32-unknown-unknown -p cep18-test-contract
wasm-strip target/wasm32-unknown-unknown/release/cep18.wasm
wasm-strip target/wasm32-unknown-unknown/release/cep18_test_contract.wasm
setup-test: build-contract
mkdir -p tests/wasm
cp ./target/wasm32-unknown-unknown/release/cep18.wasm tests/wasm
cp ./target/wasm32-unknown-unknown/release/cep18_test_contract.wasm tests/wasm
test: setup-test
cd tests && cargo test
clippy:
cd cep18 && cargo clippy --all-targets -- -D warnings
cd cep18-test-contract && cargo clippy --all-targets -- -D warnings
cd tests && cargo clippy --all-targets -- -D warnings
check-lint: clippy
cd cep18 && cargo fmt -- --check
cd cep18-test-contract && cargo fmt -- --check
cd tests && cargo fmt -- --check
lint: clippy
cd cep18 && cargo fmt
cd cep18-test-contract && cargo fmt
cd tests && cargo fmt
clean:
cd cep18 && cargo clean
cd cep18-test-contract && cargo clean
cd tests && cargo clean
rm -rf tests/wasm