-
Notifications
You must be signed in to change notification settings - Fork 8
/
utils.mk
48 lines (43 loc) · 1012 Bytes
/
utils.mk
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
define ic-wasm
echo "Optimize with ic-wasm"; \
for f in $(1)/*/*.wasm; do ic-wasm -o $$f $$f optimize O3 --keep-name-section; done
endef
define build_with_mops
set -e; \
cd $(1); \
envsubst < mops.template.toml > mops.toml; \
mops install; \
dfx canister create --all; \
dfx ledger fabricate-cycles --t 100 --canister $$(dfx identity get-wallet); \
dfx build; \
rm mops.toml; \
$(call ic-wasm,.dfx/local/canisters/); \
cd ..
endef
define build
set -e; \
cd $(1); \
dfx canister create --all; \
dfx ledger fabricate-cycles --t 100 --canister $$(dfx identity get-wallet); \
dfx build; \
$(call ic-wasm,.dfx/local/canisters/); \
cd ..
endef
define prepare_perf
mkdir -p ../_out/$(1); \
cp README.md ../_out/$(1); \
cd ../_out/$(1)
endef
define perf
set -e; \
$(call prepare_perf,$(1)); \
ic-repl -v ../../$(1)/$(2); \
du -h ../../_out
endef
define perf_two
set -e; \
$(call prepare_perf,$(1)); \
ic-repl -v ../../$(1)/$(2); \
ic-repl -v ../../$(1)/$(3); \
du -h ../../_out
endef