Makefile 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # Cargo binary
  2. CARGO ?= cargo
  3. # Zkas binary
  4. ZKAS ?= ../../../zkas
  5. # zkas circuit source files
  6. ZKAS_SRC = $(shell find proof -type f -name '*.zk')
  7. # wasm source files
  8. WASM_SRC = \
  9. $(shell find src -type f) \
  10. $(shell find ../../sdk -type f) \
  11. $(shell find ../../serial -type f)
  12. # zkas circuit bin files
  13. ZKAS_BIN = $(ZKAS_SRC:=.bin)
  14. # Contract WASM binaries
  15. WASM_BIN = money_contract.wasm
  16. # Filter test to run
  17. FILTER = ''
  18. all: $(ZKAS_BIN) $(WASM_BIN)
  19. $(ZKAS_BIN): $(ZKAS_SRC)
  20. $(ZKAS) $(basename $@) -o $@
  21. money_contract.wasm: $(ZKAS_BIN) $(WASM_SRC)
  22. $(CARGO) build --release --package darkfi-money-contract --target wasm32-unknown-unknown
  23. cp -f ../../../target/wasm32-unknown-unknown/release/darkfi_money_contract.wasm $@
  24. test-drop-pay-swap: all
  25. $(CARGO) test --release --features=no-entrypoint,client --package darkfi-money-contract --test drop_pay_swap
  26. test-tx-verification: all
  27. $(CARGO) test --release --features=no-entrypoint,client --package darkfi-money-contract --test tx_verification $(FILTER)
  28. test: test-drop-pay-swap test-tx-verification
  29. bench:
  30. $(CARGO) test --release --features=no-entrypoint,client \
  31. --package darkfi-money-contract \
  32. --test verification_bench
  33. clean:
  34. rm -f $(ZKAS_BIN) $(WASM_BIN)
  35. .PHONY: all test clean