Makefile 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. .POSIX:
  2. # Install prefix
  3. PREFIX = /usr/local
  4. # Cargo binary
  5. CARGO = cargo
  6. # Binaries to be built
  7. BINS = zkas drk darkfid gatewayd
  8. # Common dependencies which should force the binaries to be rebuilt
  9. BINDEPS = \
  10. Cargo.toml \
  11. $(shell find bin/*/src -type f) \
  12. $(shell find bin -type f -name '*.toml') \
  13. $(shell find src -type f) \
  14. $(shell find sql -type f) \
  15. $(shell find contrib/token -type f)
  16. all: $(BINS)
  17. $(BINS): $(BINDEPS)
  18. $(CARGO) build --all-features --release --package $@
  19. cp -f target/release/$@ $@
  20. check:
  21. $(CARGO) hack check --release --feature-powerset --all
  22. fix:
  23. $(CARGO) clippy --release --all-features --fix --allow-dirty --all
  24. clippy:
  25. $(CARGO) clippy --release --all-features --all
  26. test: test-vm test-tx
  27. $(CARGO) test --release --all-features --all
  28. test-tx:
  29. $(CARGO) run --release --features=node,zkas --example tx
  30. VM_SRC = proof/arithmetic.zk proof/mint.zk proof/burn.zk
  31. VM_BIN = $(VM_SRC:=.bin)
  32. $(VM_BIN): zkas $(VM_SRC)
  33. ./zkas $(basename $@) -o $@
  34. test-vm: $(VM_BIN)
  35. $(CARGO) run --release --features=crypto,zkas --example arithmetic
  36. $(CARGO) run --release --features=crypto,zkas --example mint
  37. $(CARGO) run --release --features=crypto,zkas --example burn
  38. clean:
  39. rm -f $(BINS)
  40. install: all
  41. mkdir -p $(DESTDIR)$(PREFIX)/bin
  42. cp -f $(BINS) $(DESTDIR)$(PREFIX)/bin
  43. uninstall:
  44. for i in $(BINS); \
  45. do \
  46. rm -f $(DESTDIR)$(PREFIX)/bin/$$i; \
  47. done;
  48. .PHONY: all check fix clippy test test-tx test-vm clean install uninstall