Makefile 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. .POSIX:
  2. # Install prefix
  3. PREFIX = /usr/local
  4. # Cargo binary
  5. CARGO = cargo
  6. # Binaries to be built
  7. BINS = 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 zkas -type f) \
  14. $(shell find src -type f) \
  15. $(shell find sql -type f) \
  16. $(shell find contrib/token -type f)
  17. all: $(BINS)
  18. $(BINS): $(BINDEPS)
  19. $(CARGO) build --all-features --release --package $@
  20. cp -f target/release/$@ $@
  21. check:
  22. $(CARGO) hack check --release --feature-powerset --all
  23. fix:
  24. $(CARGO) clippy --release --all-features --fix --allow-dirty --all
  25. clippy:
  26. $(CARGO) clippy --release --all-features --all
  27. test:
  28. $(CARGO) test --release --all-features --all
  29. $(CARGO) run --release --features=node --example tx
  30. clean:
  31. rm -f $(BINS)
  32. install: all
  33. mkdir -p $(DESTDIR)$(PREFIX)/bin
  34. cp -f $(BINS) $(DESTDIR)$(PREFIX)/bin
  35. uninstall:
  36. for i in $(BINS); \
  37. do \
  38. rm -f $(DESTDIR)$(PREFIX)/bin/$$i; \
  39. done;
  40. .PHONY: all check fix clippy test clean install uninstall