Makefile (614B)
1 .POSIX: 2 3 SRC = \ 4 $(shell find src -type f) \ 5 $(shell find smart-contract -type f) \ 6 $(shell find drk-sdk -type f) 7 8 # Cargo binary 9 CARGO = cargo 10 11 # wasm-strip binary (build with "make wabt" and change path) 12 WASM_STRIP = wasm-strip 13 14 DEPS = smart_contract.wasm 15 16 all: $(DEPS) 17 $(CARGO) test --release --lib -- --nocapture 18 19 wabt: 20 git clone --recursive https://github.com/WebAssembly/wabt $@ 21 $(MAKE) -C $@ 22 23 smart_contract.wasm: $(SRC) 24 cd smart-contract && $(CARGO) build --release --lib --target wasm32-unknown-unknown 25 cp -f smart-contract/target/wasm32-unknown-unknown/release/$@ $@ 26 -wasm-strip $@ 27 28 .PHONY: all