forked from tezos/tezos-mirror
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kernels.mk
90 lines (71 loc) · 2.55 KB
/
kernels.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
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
# SPDX-FileCopyrightText: 2023 Nomadic Labs <contact@nomadic-labs.com>
# SPDX-FileCopyrightText: 2023 TriliTech <contact@trili.tech>
# SPDX-FileCopyrightText: 2023 Functori <contact@functori.com>
#
# SPDX-License-Identifier: MIT
KERNELS=tx_kernel.wasm tx_kernel_dal.wasm dal_echo_kernel.wasm
SDK_DIR=src/kernel_sdk
DEMO_DIR=src/kernel_tx_demo
.PHONY: all
all: build-dev-deps check test build
all: build-dev-deps check test build
.PHONY: kernel_sdk
kernel_sdk:
@make -C src/kernel_sdk build
@cp src/kernel_sdk/target/$(NATIVE_TARGET)/release/smart-rollup-installer .
.PHONY: tx_demo_collector
tx_demo_collector:
@make -C src/kernel_tx_demo build
@cp src/kernel_tx_demo/target/$(NATIVE_TARGET)/release/tx-demo-collector .
tx_kernel.wasm: tx_demo_collector
# TODO: https://gitlab.com/tezos/tezos/-/issues/6407
# There is an issue where `wasm-strip` fails for `tx_kernel.wasm`.
# Use `wasm-strip` once this issue is solved.
@cp src/kernel_tx_demo/target/wasm32-unknown-unknown/release/tx_kernel.wasm $@
tx_kernel_dal.wasm: tx_demo_collector
# TODO: https://gitlab.com/tezos/tezos/-/issues/6407
# There is an issue where `wasm-strip` fails for `tx_kernel.wasm`.
# Use `wasm-strip` once this issue is solved.
@cp src/kernel_tx_demo/target/wasm32-unknown-unknown/release/tx_kernel_dal.wasm $@
dal_echo_kernel.wasm:
@make -C src/kernel_dal_echo build
@cp src/kernel_dal_echo/target/wasm32-unknown-unknown/release/dal_echo_kernel.wasm $@
@wasm-strip $@
.PHONY: build
build: ${KERNELS} kernel_sdk
.PHONY: clang-supports-wasm
clang-supports-wasm:
./scripts/kernels_check_clang.sh
.PHONY: build-dev-deps
build-dev-deps: clang-supports-wasm build-deps
@make -C ${SDK_DIR} build-dev-deps
@make -C ${DEMO_DIR} build-dev-deps
.PHONY: build-deps
build-deps:
@make -C ${SDK_DIR} build-deps
@make -C ${DEMO_DIR} build-deps
# Iterate through all the toolchains. 'rustup show' will install the
# toolchain in addition to showing toolchain information.
@find ${SDK_DIR} ${DEMO_DIR} -iname 'rust-toolchain*' -execdir rustup show active-toolchain \; 2>/dev/null
.PHONY: test
test:
@make -C ${SDK_DIR} test
@make -C ${DEMO_DIR} test
.PHONY: check
check: build-dev-deps
@make -C ${SDK_DIR} check
@make -C ${DEMO_DIR} check
# Check formatting of all crates.
@exec scripts/check-format-rust.sh
.PHONY: publish-sdk-deps
publish-sdk-deps: build-deps
@make -C ${SDK_DIR} publish-deps
.PHONY: publish-sdk
publish-sdk:
@make -C ${SDK_DIR} publish
.PHONY: clean
clean:
@rm -f ${KERNELS}
@make -C ${SDK_DIR} clean
@make -C ${DEMO_DIR} clean
@rm -f smart-rollup-installer tx-demo-collector