gba/Makefile.toml
Neil P 5114f89448
Simplify build process (#106)
* Simplify build process

- Remove dependencies on DevkitPro
- Use linker similarly to min-gba
- Update cargo.toml so that dev builds will build
- Update cargo config so that std builds can run without the linker for
  testing purposes
- Update CI flow to remove xbuild dependency

* Add windows toolchain install

* Add windows section to toolchain install instructions
2021-02-20 11:49:40 -07:00

71 lines
1.8 KiB
TOML

[config]
skip_core_tasks = true
[tasks.verify-toolchain]
script_runner = "@duckscript"
script = [
'''
channel = get_env CARGO_MAKE_RUST_CHANNEL
assert_eq ${channel} nightly "Rust toolchain must be set to nightly"
'''
]
[tasks.build-examples-debug]
dependencies = ["verify-toolchain"]
command = "cargo"
args = ["build", "--examples", "--target=thumbv4t-none-eabi", "-Zbuild-std=core"]
[tasks.build-examples-release]
dependencies = ["verify-toolchain"]
command = "cargo"
args = ["build", "--examples", "--release", "--target=thumbv4t-none-eabi", "-Zbuild-std=core"]
[tasks.pack-roms]
script_runner = "@duckscript"
script = [
'''
release_target = get_env RELEASE_TARGET
examples_path = set ./target/thumbv4t-none-eabi/${release_target}/examples
examples = glob_array ./examples/*.rs
for example in ${examples}
example = substring ${example} -3
example = basename ${example}
binary_exists = is_path_exists ${examples_path}/${example}
if ${binary_exists}
echo "Packing: ${examples_path}/${example} to ${examples_path}/${example}.gba"
exec arm-none-eabi-objcopy -O binary ${examples_path}/${example} ${examples_path}/${example}.gba
echo "Fixing headers: ${examples_path}/${example}.gba"
exec gbafix ${examples_path}/${example}.gba
else
echo "Binary does not exist: ${examples_path}/${example}"
end
end
'''
]
[tasks.pack-roms-release]
dependencies = ["build-examples-release"]
env = { RELEASE_TARGET = "release" }
run_task = "pack-roms"
[tasks.pack-roms-debug]
dependencies = ["build-examples-debug"]
env = { RELEASE_TARGET = "debug" }
run_task = "pack-roms"
[tasks.test]
dependencies = ["verify-toolchain"]
command = "cargo"
args = ["test", "--lib"]
[tasks.justrelease]
dependencies = ["pack-roms-release"]
[tasks.build-all]
dependencies = ["pack-roms-debug", "pack-roms-release"]
[tasks.default]
alias = "build-all"