-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.toml
67 lines (55 loc) · 1.65 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
[tasks.verify-toolchain]
script_runner = "@duckscript"
script = [
'''
channel = get_env CARGO_MAKE_RUST_CHANNEL
echo "Toolchain channel: ${channel}"
assert_eq ${channel} nightly "Rust toolchain must be set to nightly"
'''
]
[tasks.build-rom-debug]
dependencies = ["verify-toolchain"]
command = "cargo"
args = ["build", "--target=thumbv4t-none-eabi", "-Zbuild-std=core"]
[tasks.build-rom-release]
dependencies = ["verify-toolchain"]
command = "cargo"
args = ["build", "--release", "--target=thumbv4t-none-eabi", "-Zbuild-std=core"]
[tasks.pack-rom]
script_runner = "@duckscript"
script = [
'''
bin_name = set gba-dvd
release_target = get_env RELEASE_TARGET
path = set ./target/thumbv4t-none-eabi/${release_target}
path_exists = is_path_exists ${path}/${bin_name}.gba
if {path_exists}
echo "Packing: ${path}/${example} to ${path}/${bin_name}.gba"
exec arm-none-eabi-objcopy -O binary ${path}/${bin_name} ${path}/${bin_name}.gba
echo "Fixing headers: ${path}/${bin_name}.gba"
exec gbafix ${path}/${bin_name}.gba
echo "Copying ${path}/${bin_name}.gba to ./${bin_name}.gba"
exec cp ${path}/${bin_name}.gba ./${bin_name}.gba
end
'''
]
[tasks.pack-rom-release]
dependencies = ["build-rom-release"]
env = { RELEASE_TARGET = "release" }
run_task = "pack-rom"
[tasks.pack-rom-debug]
dependencies = ["build-rom-debug"]
env = { RELEASE_TARGET = "debug" }
run_task = "pack-rom"
[tasks.test]
dependencies = ["verify-toolchain"]
command = "cargo"
args = ["test", "--lib"]
[tasks.justrelease]
dependencies = ["pack-rom-release"]
[tasks.build-all]
dependencies = ["pack-rom-debug", "pack-rom-release"]
[tasks.default]
alias = "build-all"