forked from coliasgroup/seL4-summit-2024-rust-training-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
97 lines (78 loc) · 1.94 KB
/
Makefile
File metadata and controls
97 lines (78 loc) · 1.94 KB
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
#
# Copyright 2024, Colias Group, LLC
#
# SPDX-License-Identifier: BSD-2-Clause
#
build_dir := build
.PHONY: none
none:
$(build_dir):
mkdir -p $(build_dir)
workspaces := \
root-task \
microkit
examples := \
root-task/hello-world \
root-task/kernel-objects \
root-task/address-space \
root-task/serial-device \
root-task/spawn-task \
root-task/spawn-thread \
microkit/hello-world \
microkit/ipc \
microkit/shared-memory \
microkit/banscii
.PHONY: clean-each-example test-each-example
clean-each-example test-each-example:
set -eu; \
$(foreach example,$(examples), \
$(MAKE) -C workspaces/$(example) $(subst -each-example,,$@);)
.PHONY: clean
clean:
rm -rf $(build_dir)
.PHONY: clean-all
clean-all: clean clean-each-example
.PHONY: test
test: test-each-example
.PHONY: fmt
fmt:
set -eu; \
$(foreach workspace,$(workspaces), \
(cd workspaces/$(workspace) && cargo fmt);)
.PHONY: fmt-check
fmt-check:
set -eu; \
$(foreach workspace,$(workspaces), \
(cd workspaces/$(workspace) && cargo fmt --check);)
.PHONY: update
update:
set -eu; \
$(foreach workspace,$(workspaces), \
(cd workspaces/$(workspace) && cargo update);)
rustdoc_dir := $(build_dir)/rustdoc
.PHONY: rustdoc
rustdoc:
set -eu; \
$(foreach workspace,$(workspaces), \
(cd workspaces/$(workspace) && \
cargo doc --target-dir $(abspath $(rustdoc_dir)/$(workspace)));)
.PHONY: clean-rustdoc
clean-rustdoc:
rm -rf $(rustdoc_dir)
.PHONY: prune-rustdoc
prune-rustdoc:
set -eu; \
cd $(rustdoc_dir); \
rm -rf */debug */*/debug
.PHONY: check-step
check-step: fmt-check test
# exported_rustdoc_dir := $(build_dir)/exported-rustdoc
# .PHONY: exported-rustdoc
# exported-rustdoc: rustdoc | $(build_dir)
# rm -rf $(exported_rustdoc_dir)
# time rsync -av $(rustdoc_dir)/ $(exported_rustdoc_dir)/ \
# --info=progress2 --info=name0 \
# --exclude '/*/debug' \
# --exclude '/*/*/debug' \
# --exclude '/*/.*.json' \
# --exclude '/*/CACHEDIR.TAG'