Makefile 1.3 KB

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