Makefile 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. .POSIX:
  2. # Install prefix
  3. PREFIX = $(HOME)/.cargo
  4. # Cargo binary
  5. CARGO = cargo +nightly
  6. # Compile target for system binaries
  7. RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)
  8. # Uncomment when doing musl static builds
  9. #RUSTFLAGS = -C target-feature=+crt-static -C link-self-contained=yes
  10. # Binaries to be built
  11. BINS = \
  12. zkas \
  13. darkfid \
  14. darkfid2 \
  15. faucetd \
  16. darkirc \
  17. genev/genev-cli \
  18. genev/genevd \
  19. lilith \
  20. tau/tau-cli \
  21. tau/taud \
  22. vanityaddr
  23. # ZK proofs to compile with zkas
  24. PROOFS_SRC = $(shell find proof -type f -name '*.zk') example/simple.zk
  25. PROOFS_BIN = $(PROOFS_SRC:=.bin)
  26. all: $(BINS)
  27. zkas:
  28. $(MAKE) -C bin/zkas \
  29. PREFIX="$(PREFIX)" \
  30. CARGO="$(CARGO)" \
  31. RUST_TARGET="$(RUST_TARGET)" \
  32. RUSTFLAGS="$(RUSTFLAGS)"
  33. $(PROOFS_BIN): zkas $(PROOFS_SRC)
  34. ./zkas $(basename $@) -o $@
  35. contracts: zkas
  36. $(MAKE) -C src/contract/money
  37. $(MAKE) -C src/contract/dao
  38. $(MAKE) -C src/contract/consensus
  39. $(MAKE) -C src/contract/deployooor
  40. darkfid: $(PROOFS_BIN) contracts
  41. $(MAKE) -C bin/darkfid
  42. darkfid2: contracts
  43. $(MAKE) -C bin/darkfid2
  44. faucetd: contracts
  45. $(MAKE) -C bin/faucetd
  46. darkirc:
  47. $(MAKE) -C bin/darkirc
  48. genev:
  49. $(MAKE) -C bin/genev/genev-cli
  50. genevd:
  51. $(MAKE) -C bin/genev/genevd
  52. lilith:
  53. $(MAKE) -C bin/lilith
  54. tau:
  55. $(MAKE) -C bin/tau/tau-cli
  56. taud:
  57. $(MAKE) -C bin/tau/taud
  58. vanityaddr:
  59. $(MAKE) -C bin/vanityaddr
  60. fmt:
  61. $(CARGO) fmt
  62. check: $(PROOFS_BIN) contracts
  63. $(CARGO) hack check --release --feature-powerset --workspace
  64. clippy: $(PROOFS_BIN) contracts
  65. $(CARGO) clippy --release --all-features --workspace --tests
  66. fix: $(PROOFS_BIN) contracts
  67. $(CARGO) clippy --release --all-features --fix --allow-dirty --workspace --tests
  68. rustdoc: $(PROOFS_BIN) contracts
  69. $(CARGO) doc --release --all-features --workspace --document-private-items --no-deps
  70. test: $(PROOFS_BIN) contracts
  71. $(CARGO) test --release --all-features --workspace
  72. coverage: $(PROOFS_BIN) contracts
  73. $(CARGO) llvm-cov --release --all-features --workspace --html
  74. clean:
  75. $(MAKE) -C src/contract/money clean
  76. $(MAKE) -C src/contract/dao clean
  77. $(MAKE) -C src/contract/consensus clean
  78. $(MAKE) -C src/contract/deployooor clean
  79. $(MAKE) -C bin/zkas clean
  80. $(MAKE) -C bin/darkfid clean
  81. $(MAKE) -C bin/darkfid2 clean
  82. $(MAKE) -C bin/faucetd clean
  83. $(MAKE) -C bin/darkirc clean
  84. $(MAKE) -C bin/genev/genev-cli clean
  85. $(MAKE) -C bin/genev/genevd clean
  86. $(MAKE) -C bin/lilith clean
  87. $(MAKE) -C bin/tau/tau-cli clean
  88. $(MAKE) -C bin/tau/taud clean
  89. $(MAKE) -C bin/vanityaddr clean
  90. rm -f $(PROOFS_BIN)
  91. distclean: clean
  92. $(CARGO) clean
  93. rm -rf target
  94. install: $(BINS)
  95. @for i in $(BINS); \
  96. do \
  97. $(MAKE) -C bin/$$i install; \
  98. done;
  99. uninstall:
  100. for i in $(BINS); \
  101. do \
  102. $(MAKE) -C bin/$$i uninstall; \
  103. done;
  104. .PHONY: all contracts check fix fmt clippy rustdoc test coverage distclean clean install uninstall $(BINS)