-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
160 lines (134 loc) · 3.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
# Currently selected kernel module to build
MODULE_NAME ?= "text_to_morse"
help:
echo "This makefile supports the following targets:"
echo
echo "Configuration targets:"
echo " - configure_buildroot - Configure buildroot environment"
echo " - configure_linux - Configure linux kernel"
echo
echo "Build targets:"
echo " - build_env - Build entire kernel development environment"
echo " - build_buildroot - Build buildroot environment"
echo " - build_linux - Build linux with rustdoc and rust-project.json"
echo " - build_linux_kernel - Build linux kernel only"
echo " - build_linux_rustdoc - Build rustdoc from linux kernel"
echo " - build_linux_rustproject - Build rust-project.json from linux kernel"
echo " - build_module - Build out-of-tree kernel module"
echo
echo "Cleanup targets:"
echo " - clean_env - Delete virtual environment"
echo " - clean_buildroot - Delete buildroot build artifacts"
echo " - clean_linux - Delete linux kernel build artifacts"
echo " - clean_module - Delete out-of-tree kernel module build artifacts"
echo
echo "Development targets:"
echo " - load_module - Deploy kernel module into linux environment and load it"
echo " - unload_module - Unload kernel module"
echo " - start_env - Start linux environment"
echo " - stop_env - Shutdown linux environment"
echo " - login - Login into linux environment"
echo " - login_kernel_log - Login into linux environment and follow kernel log"
echo " - open_rustdoc - Open rustdoc for linux kernel facilities."
echo
echo "Other targets:"
echo " - slides - Build slides"
echo " - presentation - Build slides and spawn presentation mode"
echo " - shellcheck - Check bash scripts under scripts"
# Configuration targets
configure_buildroot:
./scripts/configure_buildroot.sh
configure_linux:
./scripts/configure_linux.sh
# Build targets
build_env:
./scripts/build_env.sh
build_buildroot:
./scripts/build_buildroot.sh
build_linux:
./scripts/build_linux.sh
build_linux_kernel:
./scripts/build_linux.sh "ONLY_LINUX"
build_linux_rustdoc:
./scripts/build_linux.sh "ONLY_LINUX_RUSTDOC"
build_linux_rustproject:
./scripts/build_linux.sh "ONLY_LINUX_RUSTPROJECT"
build_module:
./scripts/build_module.sh $(MODULE_NAME)
# Clean targets
clean_env:
./scripts/clean_env.sh
clean_buildroot:
./scripts/clean_buildroot.sh
clean_linux:
./scripts/clean_linux.sh
clean_module:
./scripts/clean_module.sh $(MODULE_NAME)
# Development targets
load_module:
./scripts/load_module.sh $(MODULE_NAME)
unload_module:
./scripts/unload_module.sh $(MODULE_NAME)
start_env:
./scripts/start_qemu.sh
stop_env:
./scripts/stop_qemu.sh
login:
./scripts/login_qemu.sh
login_kernel_log:
./scripts/login_qemu_kernel_log.sh
open_rustdoc:
./scripts/open_rustdoc.sh
# Other targets
slides:
./scripts/build_slides.sh
presentation:
./scripts/start_slides.sh
shellcheck:
shellcheck -a -s bash scripts/*
.PHONY:\
help\
configure_buildroot\
configure_linux\
build_buildroot\
build_linux\
build_linux_kernel\
build_linux_rustdoc\
build_linux_rustproject\
build_module\
build_env\
clean_env\
clean_module\
load_module\
unload_module\
start_env\
stop_env\
login\
login_kernel_log\
open_rustdoc\
slides\
presentation\
shellcheck
.SILENT:\
help\
configure_buildroot\
configure_linux\
build_buildroot\
build_linux\
build_linux_kernel\
build_linux_rustdoc\
build_linux_rustproject\
build_module\
build_env\
clean_env\
clean_module\
load_module\
unload_module\
start_env\
stop_env\
login\
login_kernel_log\
open_rustdoc\
slides\
presentation\
shellcheck