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