-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.toml
More file actions
91 lines (79 loc) · 1.75 KB
/
Makefile.toml
File metadata and controls
91 lines (79 loc) · 1.75 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
# ____ _ _ ___ ____
# / ___| |__ __ _ __| |/ _ \/ ___|
# | | | '_ \ / _` |/ _` | | | \___ \
# | |___| | | | (_| | (_| | |_| |___) |
# \____|_| |_|\__,_|\__,_|\___/|____/
# https://github.com/NewDawn0/ChadOS
#
# @Author: NewDawn0
# @Contributors: -
# @License: MIT
#
# File: Makefile.toml
# Desc: Makefile / Build instructions
env_files = ["./build-cfg/make.env"]
[tasks.default]
alias = "help"
[tasks.clean]
clear = true
script_runner = "@shell"
script = '''
cargo clean
'''
[tasks.pre-build]
clear = true
private = true
script_runner = "@shell"
script = '''
rm -rf .build ${IMG_NAME}
mkdir .build
qemu-img create .build/${IMG_NAME} 100M
'''
[tasks.build]
clear = true
dependencies = ["pre-build", "build-rs", "post-build", "build-img"]
command = "mv"
args = [".build/${IMG_NAME}", "${IMG_NAME}"]
[tasks.build-rs]
clear = true
private = true
command = "cargo"
args = ["bootimage", "--release", "--config", ".cargo/config.toml"]
[tasks.build-img]
clear = true
private = true
command = "dd"
args = [
"conv=notrunc",
"if=./target/x86-64/release/bootimage-ChadOS.bin",
"of=./.build/${IMG_NAME}",
]
[tasks.post-build]
clear = true
private = true
script_runner = "@shell"
script = '''
strip ./target/x86-64/release/bootimage-ChadOS.bin
'''
[tasks.test]
clear = true
command = "cargo"
args = ["test"]
[tasks.help]
clear = true
script_runner = "@shell"
script = '''
echo 'USAGE:'
echo ' cargo make <task>'
echo
echo 'Available tasks'
echo ' run Runs the OS in qemu'
echo ' help Prints this menu'
echo ' test Runs the test suite'
echo ' build Builds the OS to a disk image'
'''
[tasks.run]
clear = true
dependencies = ["build"]
command = "qemu-system-x86_64"
args = ["-drive", "format=raw,file=ChadOS.img"]