Makefile 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 Cargo.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:
  27. $(CARGO) test --release --all-features --all
  28. $(CARGO) run --release --features=node --example tx
  29. clean:
  30. rm -f $(BINS)
  31. install: all
  32. mkdir -p $(DESTDIR)$(PREFIX)/bin
  33. mkdir -p $(DESTDIR)$(PREFIX)/share/darkfi
  34. mkdir -p $(DESTDIR)$(PREFIX)/share/doc/darkfi
  35. cp -f $(BINS) $(DESTDIR)$(PREFIX)/bin
  36. for i in $(BINS); \
  37. do \
  38. cp -f example/config/$$i.toml $(DESTDIR)$(PREFIX)/share/doc/darkfi; \
  39. done;
  40. uninstall:
  41. for i in $(BINS); \
  42. do \
  43. rm -f $(DESTDIR)$(PREFIX)/bin/$$i; \
  44. done;
  45. rm -rf $(DESTDIR)$(PREFIX)/share/doc/darkfi
  46. rm -rf $(DESTDIR)$(PREFIX)/share/darkfi
  47. .PHONY: all check fix clippy test clean install uninstall