Makefile 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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. darkfi-mmproxy \
  18. genev/genev-cli \
  19. genev/genevd \
  20. lilith \
  21. tau/tau-cli \
  22. tau/taud \
  23. vanityaddr
  24. # ZK proofs to compile with zkas
  25. PROOFS_SRC = $(shell find proof -type f -name '*.zk') example/simple.zk
  26. PROOFS_BIN = $(PROOFS_SRC:=.bin)
  27. all: $(BINS)
  28. zkas:
  29. $(MAKE) -C bin/zkas \
  30. PREFIX="$(PREFIX)" \
  31. CARGO="$(CARGO)" \
  32. RUST_TARGET="$(RUST_TARGET)" \
  33. RUSTFLAGS="$(RUSTFLAGS)"
  34. $(PROOFS_BIN): zkas $(PROOFS_SRC)
  35. ./zkas $(basename $@) -o $@
  36. contracts: zkas
  37. $(MAKE) -C src/contract/money
  38. $(MAKE) -C src/contract/dao
  39. $(MAKE) -C src/contract/consensus
  40. $(MAKE) -C src/contract/deployooor
  41. darkfid: $(PROOFS_BIN) contracts
  42. $(MAKE) -C bin/darkfid
  43. darkfid2: contracts
  44. $(MAKE) -C bin/darkfid2
  45. faucetd: contracts
  46. $(MAKE) -C bin/faucetd
  47. darkirc:
  48. $(MAKE) -C bin/darkirc \
  49. PREFIX="$(PREFIX)" \
  50. CARGO="$(CARGO)" \
  51. RUST_TARGET="$(RUST_TARGET)" \
  52. RUSTFLAGS="$(RUSTFLAGS)"
  53. darkfi-mmproxy:
  54. $(MAKE) -C bin/darkfi-mmproxy \
  55. PREFIX="$(PREFIX)" \
  56. CARGO="$(CARGO)" \
  57. RUST_TARGET="$(RUST_TARGET)" \
  58. RUSTFLAGS="$(RUSTFLAGS)"
  59. genev:
  60. $(MAKE) -C bin/genev/genev-cli
  61. genevd:
  62. $(MAKE) -C bin/genev/genevd
  63. lilith:
  64. $(MAKE) -C bin/lilith
  65. tau:
  66. $(MAKE) -C bin/tau/tau-cli
  67. taud:
  68. $(MAKE) -C bin/tau/taud
  69. vanityaddr:
  70. $(MAKE) -C bin/vanityaddr
  71. fmt:
  72. $(CARGO) fmt
  73. check: $(PROOFS_BIN) contracts
  74. $(CARGO) hack check --release --feature-powerset --workspace
  75. clippy: $(PROOFS_BIN) contracts
  76. $(CARGO) clippy --release --all-features --workspace --tests
  77. fix: $(PROOFS_BIN) contracts
  78. $(CARGO) clippy --release --all-features --fix --allow-dirty --workspace --tests
  79. rustdoc: $(PROOFS_BIN) contracts
  80. $(CARGO) doc --release --all-features --workspace --document-private-items --no-deps
  81. test: $(PROOFS_BIN) contracts
  82. $(CARGO) test --release --all-features --workspace
  83. coverage: $(PROOFS_BIN) contracts
  84. $(CARGO) llvm-cov --release --all-features --workspace --html
  85. clean:
  86. $(MAKE) -C src/contract/money clean
  87. $(MAKE) -C src/contract/dao clean
  88. $(MAKE) -C src/contract/consensus clean
  89. $(MAKE) -C src/contract/deployooor clean
  90. $(MAKE) -C bin/zkas clean
  91. $(MAKE) -C bin/darkfid clean
  92. $(MAKE) -C bin/darkfid2 clean
  93. $(MAKE) -C bin/darkfi-mmproxy clean
  94. $(MAKE) -C bin/faucetd clean
  95. $(MAKE) -C bin/darkirc clean
  96. $(MAKE) -C bin/genev/genev-cli clean
  97. $(MAKE) -C bin/genev/genevd clean
  98. $(MAKE) -C bin/lilith clean
  99. $(MAKE) -C bin/tau/tau-cli clean
  100. $(MAKE) -C bin/tau/taud clean
  101. $(MAKE) -C bin/vanityaddr clean
  102. rm -f $(PROOFS_BIN)
  103. distclean: clean
  104. $(CARGO) clean
  105. rm -rf target
  106. install: $(BINS)
  107. @for i in $(BINS); \
  108. do \
  109. $(MAKE) -C bin/$$i install; \
  110. done;
  111. uninstall:
  112. for i in $(BINS); \
  113. do \
  114. $(MAKE) -C bin/$$i uninstall; \
  115. done;
  116. .PHONY: all contracts check fix fmt clippy rustdoc test coverage distclean clean install uninstall $(BINS)