forked from gear-tech/gear
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
287 lines (218 loc) · 6.59 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
# Common section
.PHONY: show
show:
@ ./scripts/gear.sh show
.PHONY: pre-commit
pre-commit: fmt check-spec clippy test
.PHONY: check-spec
check-spec:
@ ./scripts/check-spec.sh
.PHONY: clean
clean:
@ cargo clean --manifest-path=./Cargo.toml
@ cargo clean --manifest-path=./examples/Cargo.toml
.PHONY: clean-examples
clean-examples:
@ rm -rf ./target/wasm32-unknown-unknown
@ rm -rvf target/release/build/demo-*
@ cargo clean --manifest-path=./examples/Cargo.toml
# Build section
.PHONY: all
all: gear examples
.PHONY: all-release
all-release: gear-release examples
.PHONY: gear
gear:
@ ./scripts/gear.sh build gear
.PHONY: gear-release
gear-release:
@ ./scripts/gear.sh build gear --release
.PHONY: gear-test
gear-test:
@ ./scripts/gear.sh build gear-test
.PHONY: gear-test-release
gear-test-release:
@ ./scripts/gear.sh build gear-test --release
.PHONY: examples
examples: build-examples proc-examples
.PHONY: build-examples
build-examples:
@ ./scripts/gear.sh build examples yamls="$(yamls)"
.PHONY: wasm-proc
wasm-proc:
@ ./scripts/gear.sh build wasm-proc
.PHONY: wat-examples
wat-examples:
@ ./scripts/gear.sh build wat-examples
.PHONY: proc-examples
proc-examples: wasm-proc
@ ./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: node-release-rtest
node-release-rtest:
@ ./scripts/gear.sh build node --release --no-default-features --features=gear-native,lazy-pages,program-cli,runtime-test
.PHONY: vara
vara:
@ ./scripts/gear.sh build node --no-default-features --features=vara-native,lazy-pages
.PHONY: vara-release
vara-release:
@ ./scripts/gear.sh build node --release --no-default-features --features=vara-native,lazy-pages
.PHONY: vara-release-rtest
vara-release-rtest:
@ ./scripts/gear.sh build node --release --no-default-features --features=runtime-test,vara-native,lazy-pages
# Check section
.PHONY: check
check: check-gear check-examples
.PHONY: check-release
check-release: check-gear-release check-examples
.PHONY: check-gear
check-gear:
@ ./scripts/gear.sh check gear
.PHONY: check-gear-release
check-gear-release:
@ ./scripts/gear.sh check gear --release
.PHONY: check-examples
check-examples:
@ ./scripts/gear.sh check examples
# Clippy section
.PHONY: clippy
clippy: clippy-gear clippy-examples
.PHONY: clippy-release
clippy-release: clippy-gear-release clippy-examples
.PHONY: clippy-gear
clippy-gear:
@ ./scripts/gear.sh clippy gear --all-targets --all-features
.PHONY: clippy-gear-release
clippy-gear-release:
@ ./scripts/gear.sh clippy gear --release
.PHONY: clippy-examples
clippy-examples:
@ ./scripts/gear.sh clippy examples
# Docker section
.PHONY: docker-run
docker-run:
@ ./scripts/gear.sh docker run
# Format section
.PHONY: fmt
fmt: fmt-gear fmt-examples fmt-doc
.PHONY: fmt-check
fmt-check: fmt-gear-check fmt-examples-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-examples
fmt-examples:
@ ./scripts/gear.sh format examples
.PHONY: fmt-examples-check
fmt-examples-check:
@ ./scripts/gear.sh format examples --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 init-js
.PHONY: init-wasm
init-wasm:
@ ./scripts/gear.sh init wasm
.PHONY: init-js
init-js:
@ ./scripts/gear.sh init js
.PHONY: update-js
update-js:
@ ./scripts/gear.sh init update-js
.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
test: test-gear test-js gtest # There should be no release builds (e.g. `rtest`) for fast checking.
.PHONY: test-release
test-release: test-gear-release test-js gtest rtest test-runtime-upgrade
.PHONY: test-gear
test-gear: init-js examples # \
We use lazy-pages feature for pallet-gear-debug due to cargo building issue \
and fact that pallet-gear default is lazy-pages.
@ ./scripts/gear.sh test gear --exclude gclient --features pallet-gear-debug/lazy-pages
.PHONY: test-gear-release
test-gear-release: init-js examples
@ ./scripts/gear.sh test gear --release
.PHONY: test-js
test-js: init-js
@ ./scripts/gear.sh test js
.PHONY: gtest
gtest: init-js gear-test-release examples
@ ./scripts/gear.sh test gtest yamls="$(yamls)"
.PHONY: rtest
rtest: init-js node-release-rtest examples
@ ./scripts/gear.sh test rtest gear yamls="$(yamls)"
.PHONY: rtest-vara
rtest-vara: init-js vara-release-rtest examples
@ ./scripts/gear.sh test rtest vara yamls="$(yamls)"
.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-runtime-upgrade
test-runtime-upgrade: init-js examples node-release
@ ./scripts/gear.sh test runtime-upgrade
.PHONY: test-client
test-client: node-release examples wat-examples
@ ./scripts/gear.sh test client --run-node
# Misc section
.PHONY: doc
doc:
@ RUSTDOCFLAGS="--enable-index-page -Zunstable-options" cargo +nightly doc --no-deps \
-p galloc -p gclient -p gcore -p gear-backend-common -p gear-backend-sandbox \
-p gear-core -p gear-core-processor -p gear-lazy-pages -p gear-core-errors \
-p gstd -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 -p pallet-gear-scheduler
@ cp -f images/logo.svg target/doc/rust-logo.svg
.PHONY: fuzz
fuzz:
@ ./scripts/gear.sh test fuzz $(target)
.PHONY: fuzz-vara
fuzz-vara:
@ ./scripts/gear.sh test fuzz --features=vara-native,lazy-pages --no-default-features $(target)
.PHONY: kill
kill:
@ pkill -f 'gear |gear$' -9