-
Notifications
You must be signed in to change notification settings - Fork 105
/
Makefile
302 lines (234 loc) · 7.7 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
# Ethexe section
.PHONY: ethexe-pre-commit
ethexe-pre-commit: ethexe-contracts-pre-commit ethexe-pre-commit-no-contracts
.PHONY: ethexe-pre-commit-no-contracts
ethexe-pre-commit-no-contracts:
@ echo " > Formatting ethexe" && cargo +nightly fmt --all -- --config imports_granularity=Crate,edition=2021
@ echo " >> Clippy checking ethexe" && cargo clippy -p "ethexe-*" --all-targets --all-features -- --no-deps -D warnings
@ echo " >>> Testing ethexe" && cargo test -p "ethexe-*"
# Building ethexe contracts
.PHONY: ethexe-contracts-pre-commit
ethexe-contracts-pre-commit:
@ echo " > Cleaning contracts" && forge clean --root ethexe/contracts
@ echo " > Formatting contracts" && forge fmt --root ethexe/contracts
@ echo " > Building contracts" && forge build --root ethexe/contracts
@ echo " > Testing contracts" && forge test --root ethexe/contracts -vvv
@ echo " > Copying Router arfitact" && cp ./ethexe/contracts/out/Router.sol/Router.json ./ethexe/ethereum
@ echo " > Copying Mirror arfitact" && cp ./ethexe/contracts/out/Mirror.sol/Mirror.json ./ethexe/ethereum
@ echo " > Copying MirrorProxy arfitact" && cp ./ethexe/contracts/out/MirrorProxy.sol/MirrorProxy.json ./ethexe/ethereum
@ echo " > Copying WrappedVara arfitact" && cp ./ethexe/contracts/out/WrappedVara.sol/WrappedVara.json ./ethexe/ethereum
@ echo " > Copying TransparentUpgradeableProxy arfitact" && cp ./ethexe/contracts/out/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.json ./ethexe/ethereum
# Common section
.PHONY: show
show:
@ ./scripts/gear.sh show
.PHONY: pre-commit # Here should be no release builds to keep checks fast.
pre-commit: fmt typos clippy test check-runtime-imports
.PHONY: check-spec
check-spec:
@ ./scripts/check-spec.sh
.PHONY: clean
clean:
@ cargo clean
@ git clean -fdx
# Build section
.PHONY: gear
gear:
@ ./scripts/gear.sh build gear
.PHONY: gear-release
gear-release:
@ ./scripts/gear.sh build gear --release
.PHONY: examples
examples:
@ ./scripts/gear.sh build examples
.PHONY: examples-release
examples-release:
@ ./scripts/gear.sh build examples --release
.PHONY: wasm-proc
wasm-proc:
@ ./scripts/gear.sh build wasm-proc
.PHONY: wasm-proc-release
wasm-proc-release:
@ ./scripts/gear.sh build wasm-proc --release
.PHONY: examples-proc
examples-proc: wasm-proc-release
@ ./scripts/gear.sh build examples-proc
.PHONY: node
node:
@ ./scripts/gear.sh build node
.PHONY: node-release
node-release:
@ ./scripts/gear.sh build node --release
.PHONY: vara
vara:
@ ./scripts/gear.sh build node --no-default-features --features=vara-native
.PHONY: vara-release
vara-release:
@ ./scripts/gear.sh build node --release --no-default-features --features=vara-native
.PHONY: gear-replay
gear-replay:
@ ./scripts/gear.sh build gear-replay
.PHONY: gear-replay-vara-native
gear-replay-vara-native:
@ ./scripts/gear.sh build gear-replay --no-default-features --features=std,vara-native
# Check section
.PHONY: check
check:
@ ./scripts/gear.sh check gear
.PHONY: check-release
check-release:
@ ./scripts/gear.sh check gear --release
.PHONY: check-runtime-imports
check-runtime-imports:
@ ./scripts/gear.sh check runtime-imports
# Clippy section
.PHONY: clippy
clippy: clippy-gear clippy-examples
.PHONY: clippy-release
clippy-release: clippy-gear-release clippy-examples-release
.PHONY: clippy-gear
clippy-gear:
@ ./scripts/gear.sh clippy gear --all-targets --all-features
.PHONY: clippy-examples
clippy-examples:
@ ./scripts/gear.sh clippy examples --all-targets
.PHONY: clippy-gear-release
clippy-gear-release:
@ ./scripts/gear.sh clippy gear --release
.PHONY: clippy-examples-release
clippy-examples-release:
@ ./scripts/gear.sh clippy examples --all-targets --release
# Docker section
.PHONY: docker-run
docker-run:
@ ./scripts/gear.sh docker run
# Format section
.PHONY: fmt
fmt: fmt-gear fmt-doc
.PHONY: fmt-check
fmt-check: fmt-gear-check fmt-doc-check
.PHONY: fmt-gear
fmt-gear:
@ ./scripts/gear.sh format gear
.PHONY: fmt-gear-check
fmt-gear-check:
@ ./scripts/gear.sh format gear --check
.PHONY: fmt-doc
fmt-doc:
@ ./scripts/gear.sh format doc
.PHONY: fmt-doc-check
fmt-doc-check:
@ ./scripts/gear.sh format doc --check
# Init section
.PHONY: init
init: init-wasm init-cargo
.PHONY: init-wasm
init-wasm:
@ ./scripts/gear.sh init wasm
.PHONY: init-cargo
init-cargo:
@ ./scripts/gear.sh init cargo
# Run section
.PHONY: run-node
run-node:
@ ./scripts/gear.sh run node
.PHONY: run-node-release
run-node-release:
@ ./scripts/gear.sh run node --release
.PHONY: run-dev-node
run-dev-node:
@ RUST_LOG="gear_core_processor=debug,gwasm=debug,pallet_gas=debug,pallet_gear=debug" ./scripts/gear.sh run node -- --dev
.PHONY: run-dev-node-release
run-dev-node-release:
@ RUST_LOG="gear_core_processor=debug,gwasm=debug,pallet_gas=debug,pallet_gear=debug" ./scripts/gear.sh run node --release -- --dev
.PHONY: purge-chain
purge-chain:
@ ./scripts/gear.sh run purge-chain
.PHONY: purge-chain-release
purge-chain-release:
@ ./scripts/gear.sh run purge-chain --release
.PHONY: purge-dev-chain
purge-dev-chain:
@ ./scripts/gear.sh run purge-dev-chain
.PHONY: purge-dev-chain-release
purge-dev-chain-release:
@ ./scripts/gear.sh run purge-dev-chain --release
# Test section
.PHONY: test # Here should be no release builds to keep checks fast.
test: test-gear
.PHONY: test-release
test-release: test-gear-release
.PHONY: test-doc
test-doc:
@ ./scripts/gear.sh test docs
.PHONY: test-gear
test-gear: # Crates are excluded to significantly decrease time.
@ ./scripts/gear.sh test gear \
--exclude gear-authorship \
--exclude pallet-gear-staking-rewards \
--exclude gear-wasm-gen \
--exclude demo-stack-allocations \
--exclude gring
.PHONY: test-gear-release
test-gear-release:
@ ./scripts/gear.sh test gear --release
.PHONY: test-gsdk
test-gsdk: node-release
@ ./scripts/gear.sh test gsdk
.PHONY: test-gsdk-release
test-gsdk-release: node-release
@ ./scripts/gear.sh test gsdk --release
.PHONY: test-gcli
test-gcli: node
@ ./scripts/gear.sh test gcli
.PHONY: test-gcli-release
test-gcli-release: node-release
@ ./scripts/gear.sh test gcli --release
.PHONY: test-gbuild
test-gbuild: node
@ ./scripts/gear.sh test gbuild
.PHONY: test-gbuild-release
test-gbuild-release: node-release
@ ./scripts/gear.sh test gbuild --release
.PHONY: test-pallet
test-pallet:
@ ./scripts/gear.sh test pallet
.PHONY: test-pallet-release
test-pallet-release:
@ ./scripts/gear.sh test pallet --release
.PHONY: test-client
test-client: node-release
@ ./scripts/gear.sh test client
.PHONY: test-client-release
test-client-release: node-release
@ ./scripts/gear.sh test client --release
.PHONY: test-syscalls-integrity
test-syscalls-integrity:
@ ./scripts/gear.sh test syscalls
.PHONY: test-syscalls-integrity-release
test-syscalls-integrity-release:
@ ./scripts/gear.sh test syscalls --release
# Misc section
.PHONY: doc
doc:
@ RUSTDOCFLAGS="--enable-index-page --generate-link-to-definition -Zunstable-options -D warnings" cargo doc --no-deps \
-p galloc -p gclient -p gcore -p gear-core-backend \
-p gear-core -p gear-core-processor -p gear-lazy-pages -p gear-core-errors \
-p gmeta -p gtest -p gear-wasm-builder -p gear-common \
-p pallet-gear -p pallet-gear-gas -p pallet-gear-messenger -p pallet-gear-payment \
-p pallet-gear-program -p pallet-gear-rpc-runtime-api -p pallet-gear-rpc -p pallet-gear-scheduler -p gsdk
@ RUSTDOCFLAGS="--enable-index-page --generate-link-to-definition -Zunstable-options -D warnings" cargo doc --no-deps \
-p gstd -F document-features
@ cp -f images/logo.svg target/doc/rust-logo.svg
.PHONY: kill-gear
kill:
@ pkill -f 'gear |gear$' -9
.PHONY: kill-rust
kill-rust:
@ pgrep -f "rust" | sudo xargs kill -9
.PHONY: install
install:
@ cargo install --path ./node/cli --force --locked
.PHONY: typos
typos:
@ ./scripts/gear.sh test typos