/
Makefile.toml
67 lines (56 loc) · 1.53 KB
/
Makefile.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
[config]
skip_core_tasks = true
[env]
ARCH = "i686"
QEMU = { script = ['''
if '${ARCH}' = 'i686'; then
echo qemu-system-i386
else
echo qemu-system-x86_64
fi
'''] }
TARGET = "${ARCH}-unknown-funky"
KERNEL_DEBUG = "target/${TARGET}/debug/too-funky"
KERNEL_RELEASE = "target/${TARGET}/release/too-funky"
IMAGE = "funky.iso"
GRUB = "grub.cfg"
RUST_TARGET_PATH = { script = ["pwd"] }
[tasks.default]
run_task = "build"
[tasks.run]
condition = { env_set = ["QEMU", "IMAGE"] }
dependencies = ["image"]
script = ["${QEMU} -d int -no-reboot -cdrom ${IMAGE}"]
[tasks.run-release]
condition = { env_set = ["QEMU", "IMAGE"] }
dependencies = ["image-release"]
script = ["${QEMU} -cdrom ${IMAGE}"]
[tasks.image]
env = { "KERNEL" = "${KERNEL_DEBUG}" }
dependencies = ["build"]
run_task = "image-inner"
[tasks.image-release]
env = { "KERNEL" = "${KERNEL_RELEASE}" }
dependencies = ["build-release"]
run_task = "image-inner"
[tasks.image-inner]
condition = { env_set = ["GRUB", "KERNEL", "IMAGE"] }
script = [
'''
mkdir -p isofiles/boot/grub
cp ${GRUB} isofiles/boot/grub/
cp ${KERNEL} isofiles/boot/kernel.bin
grub-mkrescue -o ${IMAGE} isofiles
'''
]
[tasks.build]
condition = { channels = ["nightly"], env_set = ["TARGET", "RUST_TARGET_PATH"] }
script = ["xargo build --target ${TARGET}"]
[tasks.build-release]
condition = { channels = ["nightly"], env_set = ["TARGET", "RUST_TARGET_PATH"] }
script = ["xargo build --release --target ${TARGET}"]
[tasks.clean]
script = ["rm -rf target isofiles"]
[tasks.mrproper]
dependencies = ["clean"]
script = ["rm -f ${IMAGE}"]