Makefile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 script/sql -type f) \
  15. $(shell find contrib/token -type f)
  16. all: $(BINS)
  17. token_lists:
  18. $(MAKE) -C contrib/token all
  19. $(BINS): token_lists $(BINDEPS)
  20. $(CARGO) build --all-features --release --package $@
  21. cp -f target/release/$@ $@
  22. check:
  23. $(CARGO) hack check --release --feature-powerset --all
  24. fix:
  25. $(CARGO) clippy --release --all-features --fix --allow-dirty --all
  26. clippy:
  27. $(CARGO) clippy --release --all-features --all
  28. # zkas source files which we want to compile for tests
  29. VM_SRC = proof/arithmetic.zk proof/mint.zk proof/burn.zk
  30. VM_BIN = $(VM_SRC:=.bin)
  31. $(VM_BIN): zkas $(VM_SRC)
  32. ./zkas $(basename $@) -o $@
  33. test: $(VM_BIN) test-tx
  34. $(CARGO) test --release --all-features --all
  35. test-tx:
  36. $(CARGO) run --release --features=node,zkas --example tx
  37. clean:
  38. rm -f $(BINS)
  39. install: all
  40. mkdir -p $(DESTDIR)$(PREFIX)/bin
  41. cp -f $(BINS) $(DESTDIR)$(PREFIX)/bin
  42. uninstall:
  43. for i in $(BINS); \
  44. do \
  45. rm -f $(DESTDIR)$(PREFIX)/bin/$$i; \
  46. done;
  47. .PHONY: all check fix clippy test test-tx clean install uninstall