Makefile 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 src -type f) \
  12. $(shell find sql -type f) \
  13. $(shell find contrib/token -type f)
  14. all: $(BINS)
  15. $(BINS): $(BINDEPS)
  16. $(MAKE) -C bin/$@
  17. cp -f bin/$@/$@ $@
  18. check:
  19. $(CARGO) hack check --release --feature-powerset --no-dev-deps
  20. fix:
  21. $(CARGO) clippy --release --all-features --fix --allow-dirty
  22. clippy:
  23. $(CARGO) clippy --release --all-features
  24. test:
  25. $(CARGO) test --release --all-features
  26. clean:
  27. rm -f $(BINS)
  28. install: all
  29. mkdir -p $(DESTDIR)$(PREFIX)/bin
  30. mkdir -p $(DESTDIR)$(PREFIX)/share/darkfi
  31. mkdir -p $(DESTDIR)$(PREFIX)/share/doc/darkfi
  32. cp -f $(BINS) $(DESTDIR)$(PREFIX)/bin
  33. for i in $(BINS); \
  34. do \
  35. cp -f example/config/$$i.toml $(DESTDIR)$(PREFIX)/share/doc/darkfi; \
  36. done;
  37. uninstall:
  38. for i in $(BINS); \
  39. do \
  40. rm -f $(DESTDIR)$(PREFIX)/bin/$$i; \
  41. done;
  42. rm -rf $(DESTDIR)$(PREFIX)/share/doc/darkfi
  43. rm -rf $(DESTDIR)$(PREFIX)/share/darkfi
  44. .PHONY: all check fix clippy test clean install uninstall