Makefile 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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. PREFIX="$(PREFIX)" \
  49. CARGO="$(CARGO)" \
  50. RUST_TARGET="$(RUST_TARGET)" \
  51. RUSTFLAGS="$(RUSTFLAGS)"
  52. darkfi-mmproxy:
  53. $(MAKE) -C bin/darkfi-mmproxy \
  54. PREFIX="$(PREFIX)" \
  55. CARGO="$(CARGO)" \
  56. RUST_TARGET="$(RUST_TARGET)" \
  57. RUSTFLAGS="$(RUSTFLAGS)"
  58. genev:
  59. $(MAKE) -C bin/genev/genev-cli
  60. genevd:
  61. $(MAKE) -C bin/genev/genevd
  62. lilith:
  63. $(MAKE) -C bin/lilith
  64. tau:
  65. $(MAKE) -C bin/tau/tau-cli
  66. taud:
  67. $(MAKE) -C bin/tau/taud
  68. vanityaddr:
  69. $(MAKE) -C bin/vanityaddr
  70. fmt:
  71. $(CARGO) fmt
  72. check: $(PROOFS_BIN) contracts
  73. $(CARGO) hack check --release --feature-powerset --workspace
  74. clippy: $(PROOFS_BIN) contracts
  75. $(CARGO) clippy --release --all-features --workspace --tests
  76. fix: $(PROOFS_BIN) contracts
  77. $(CARGO) clippy --release --all-features --fix --allow-dirty --workspace --tests
  78. rustdoc: $(PROOFS_BIN) contracts
  79. $(CARGO) doc --release --all-features --workspace --document-private-items --no-deps
  80. test: $(PROOFS_BIN) contracts
  81. $(CARGO) test --release --all-features --workspace
  82. coverage: $(PROOFS_BIN) contracts
  83. $(CARGO) llvm-cov --release --all-features --workspace --html
  84. clean:
  85. $(MAKE) -C src/contract/money clean
  86. $(MAKE) -C src/contract/dao clean
  87. $(MAKE) -C src/contract/consensus clean
  88. $(MAKE) -C src/contract/deployooor clean
  89. $(MAKE) -C bin/zkas clean
  90. $(MAKE) -C bin/darkfid clean
  91. $(MAKE) -C bin/darkfid2 clean
  92. $(MAKE) -C bin/darkfi-mmproxy clean
  93. $(MAKE) -C bin/faucetd clean
  94. $(MAKE) -C bin/darkirc clean
  95. $(MAKE) -C bin/genev/genev-cli clean
  96. $(MAKE) -C bin/genev/genevd clean
  97. $(MAKE) -C bin/lilith clean
  98. $(MAKE) -C bin/tau/tau-cli clean
  99. $(MAKE) -C bin/tau/taud clean
  100. $(MAKE) -C bin/vanityaddr clean
  101. rm -f $(PROOFS_BIN)
  102. distclean: clean
  103. $(CARGO) clean
  104. rm -rf target
  105. install: $(BINS)
  106. @for i in $(BINS); \
  107. do \
  108. $(MAKE) -C bin/$$i install; \
  109. done;
  110. uninstall:
  111. for i in $(BINS); \
  112. do \
  113. $(MAKE) -C bin/$$i uninstall; \
  114. done;
  115. .PHONY: all contracts check fix fmt clippy rustdoc test coverage distclean clean install uninstall $(BINS)