Makefile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. $(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. # zkas source files which we want to compile for tests
  27. VM_SRC = proof/arithmetic.zk proof/mint.zk proof/burn.zk
  28. VM_BIN = $(VM_SRC:=.bin)
  29. $(VM_BIN): zkas $(VM_SRC)
  30. ./zkas $(basename $@) -o $@
  31. test: $(VM_BIN) test-tx
  32. $(CARGO) test --release --all-features --all
  33. test-tx:
  34. $(CARGO) run --release --features=node,zkas --example tx
  35. clean:
  36. rm -f $(BINS)
  37. install: all
  38. mkdir -p $(DESTDIR)$(PREFIX)/bin
  39. cp -f $(BINS) $(DESTDIR)$(PREFIX)/bin
  40. uninstall:
  41. for i in $(BINS); \
  42. do \
  43. rm -f $(DESTDIR)$(PREFIX)/bin/$$i; \
  44. done;
  45. .PHONY: all check fix clippy test test-tx clean install uninstall