-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (47 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
WASM_OPT := $(shell wasm-opt --version 2>/dev/null)
.PHONY: test-all
test-all: clippy test
.PHONY: clippy
clippy:
cargo clippy --tests -- -D warnings
.PHONY: test
# test: unit-test
test: unit-test integration-test
.PHONY: unit-test
unit-test:
cargo test
.PHONY: integration-test
integration-test: _build
yarn
yarn test
.PHONY: build
build: _build compress schema
.PHONY: _build
_build:
cargo build --release --target wasm32-unknown-unknown
mkdir --parents ./build
ifdef WASM_OPT
wasm-opt -Oz ./target/wasm32-unknown-unknown/release/tier.wasm -o ./build/tier.wasm
wasm-opt -Oz ./target/wasm32-unknown-unknown/release/ido.wasm -o ./build/ido.wasm
else
cp ./target/wasm32-unknown-unknown/release/tier.wasm ./build/tier.wasm
cp ./target/wasm32-unknown-unknown/release/ido.wasm ./build/ido.wasm
endif
.PHONY: compress
compress: tier.wasm.gz ido.wasm.gz
tier.wasm.gz: build/tier.wasm
cat ./build/tier.wasm | gzip -9 > ./build/tier.wasm.gz
ido.wasm.gz: build/ido.wasm
cat ./build/ido.wasm | gzip -9 > ./build/ido.wasm.gz
.PHONY: schema
schema:
cargo run --release --example schema-tier
cargo run --release --example schema-ido
.PHONY: clean
clean:
cargo clean
rm -rf ./node_modules
rm -rf ./build/tier.wasm
rm -rf ./build/tier.wasm.gz
rm -rf ./build/ido.wasm
rm -rf ./build/ido.wasm.gz