Makefile 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. # Dependencies which should force the binaries to be rebuilt
  9. BINDEPS = \
  10. Cargo.toml \
  11. $(shell find src -type f) \
  12. $(shell find sql -type f) \
  13. $(shell find contrib/token -type f) \
  14. #all: $(BINS)
  15. all: $(BINS)
  16. check:
  17. $(CARGO) hack check --feature-powerset --no-dev-deps
  18. $(BINS): $(BINDEPS)
  19. $(CARGO) build --workspace --release --all-features
  20. cp -f target/release/$@ $@
  21. test:
  22. $(CARGO) test --release --all-features
  23. $(CARGO) build --release --all-features --bin tx
  24. ./target/release/tx
  25. fix:
  26. $(CARGO) clippy --release --all-features --fix --allow-dirty
  27. clippy:
  28. $(CARGO) clippy --release --all-features
  29. install: all
  30. mkdir -p $(DESTDIR)$(PREFIX)/bin
  31. mkdir -p $(DESTDIR)$(PREFIX)/share/darkfi
  32. mkdir -p $(DESTDIR)$(PREFIX)/share/doc/darkfi
  33. cp -f $(BINS) $(DESTDIR)$(PREFIX)/bin
  34. for i in $(BINS); \
  35. do \
  36. cp -f example/config/$$i.toml $(DESTDIR)$(PREFIX)/share/doc/darkfi; \
  37. done;
  38. uninstall:
  39. for i in $(BINS); \
  40. do \
  41. rm -f $(DESTDIR)$(PREFIX)/bin/$$i; \
  42. done;
  43. rm -rf $(DESTDIR)$(PREFIX)/share/doc/darkfi
  44. rm -rf $(DESTDIR)$(PREFIX)/share/darkfi
  45. clean:
  46. rm -f $(BINS)
  47. distclean: clean
  48. rm -rf target
  49. .PHONY: all check test fix clippy install uninstall clean distclean