-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.toml
94 lines (84 loc) · 2.44 KB
/
build.toml
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
subdirs = [
"boot",
"coreutils",
"dynamic-linker",
"kernel",
"libs",
"servers",
"shell",
"tools",
"ustd",
]
# TODO: Don't pass -ffreestanding here.
cxx_flags = """\
-std=c++20 \
-fcolor-diagnostics \
-fno-builtin-bcmp \
-fno-exceptions \
-fno-rtti \
-nostdinc \
-nostdinc++ \
-nostdlib \
-I$root \
-I$root/libs \
-Wno-unused-command-line-argument \
-ffreestanding \
"""
ld_flags = "-fuse-ld=lld"
[preset.debug]
[preset.release]
cxx_flags = "-DNDEBUG -O2 -fdata-sections -ffunction-sections"
ld_flags="-Wl,--gc-sections -s"
[preset.release-small]
cxx_flags = "-DNDEBUG -Oz -fdata-sections -ffunction-sections"
ld_flags = "-Wl,--gc-sections -s"
[option.assertions]
cxx_flags = "-DASSERTIONS"
[option.assertions_pedantic]
cxx_flags = "-DASSERTIONS_PEDANTIC"
[[phony]]
name = "sysroot"
deps = ["all"]
commands = [
"cp -a $root/sysroot $build_root",
"mkdir -p sysroot/EFI/BOOT sysroot/bin sysroot/include sysroot/lib",
"cp -a boot/bootloader sysroot/EFI/BOOT/BOOTX64.EFI",
"cp -a coreutils/cat sysroot/bin/",
"cp -a coreutils/ls sysroot/bin/",
"cp -a coreutils/lspci sysroot/bin/",
"cp -a coreutils/syscfg sysroot/bin/",
"cp -a coreutils/te sysroot/bin/",
"cp -a coreutils/yes sysroot/bin/",
"cp -a dynamic-linker/dynamic-linker sysroot/bin/",
"cp -a kernel/kernel sysroot/",
"cp -a libs/config/libconfig.a sysroot/lib/",
"cp -a libs/console/libconsole.a sysroot/lib/",
"cp -a libs/core/libcore.a sysroot/lib/",
"cp -a libs/ipc/libipc.a sysroot/lib/",
"cp -a libs/log/liblog.a sysroot/lib/",
"cp -a libs/posix/libposix.a sysroot/lib/",
"cp -a servers/config/config-server sysroot/bin/",
"cp -a servers/console/console-server sysroot/bin/",
"cp -a servers/log/log-server sysroot/bin/",
"cp -a servers/system/system-server sysroot/bin/",
"cp -a servers/usb/usb-server sysroot/bin/",
"cp -a shell/shell sysroot/bin/",
"cp -a ustd/libustd.a sysroot/lib/",
"pushd $root/libs/posix && find . -name '*.h' -exec cp --parents -a {} $build_root/sysroot/include/ \\; && popd",
]
[[phony]]
name = "run"
deps = ["sysroot"]
uses_console = true
commands = [
"$root/tools/run_qemu.bash $root/OVMF.fd $build_root/sysroot",
]
[[phony]]
name = "image"
deps = ["sysroot"]
uses_console = true
commands = [
"truncate --size 28800000 $build_root/fs.img",
"mformat -i $build_root/fs.img -f 2880 -h 20 ::",
"mcopy -si $build_root/fs.img $build_root/sysroot/* ::",
]