Makefile 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. .POSIX:
  2. PREFIX = /usr/local
  3. DLURL = https://testnet.cashier.dark.fi
  4. CARGO = cargo
  5. DLTOOL = wget -nv --show-progress -O-
  6. #DLTOOL = curl
  7. # Here it's possible to append "cashierd" and "gatewayd".
  8. BINS = drk darkfid
  9. # Dependencies which should force the binaries to be rebuilt
  10. BINDEPS = \
  11. Cargo.toml \
  12. $(shell find src -type f) \
  13. $(shell find token -type f) \
  14. $(shell find sql -type f)
  15. all: $(BINS) mint.params spend.params
  16. $(BINS): $(BINDEPS)
  17. $(CARGO) build --release --all-features --bin $@
  18. cp target/release/$@ $@
  19. %.params:
  20. $(DLTOOL) $(DLURL)/$@ > $@
  21. test:
  22. $(CARGO) test --release --all-features
  23. fix:
  24. $(CARGO) fix --release --all-features --allow-dirty
  25. clippy:
  26. $(CARGO) clippy --release --all-features
  27. install: all
  28. mkdir -p $(DESTDIR)$(PREFIX)/bin
  29. mkdir -p $(DESTDIR)$(PREFIX)/share/darkfi
  30. mkdir -p $(DESTDIR)$(PREFIX)/share/doc/darkfi
  31. cp -f $(BINS) $(DESTDIR)$(PREFIX)/bin
  32. for i in $(BINS); \
  33. do \
  34. cp -f example/config/$$i.toml $(DESTDIR)$(PREFIX)/share/doc/darkfi; \
  35. done;
  36. cp -f mint.params spend.params $(DESTDIR)$(PREFIX)/share/darkfi
  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. clean:
  45. rm -f $(BINS) mint.params spend.params
  46. distclean: clean
  47. rm -rf target
  48. .PHONY: all test fix clippy install uninstall clean distclean