mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 00:01:34 +11:00
Move the linkers scripts to the src directory so agb itself can change its script
This commit is contained in:
parent
721aba3c76
commit
4ed2ea3784
|
@ -7,8 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
- There is now a multiboot feature which you can use to easily make multiboot ROMS.
|
||||
|
||||
### Changed
|
||||
- General improvements to the linker script that you will need to update.
|
||||
- You no longer need the gba.ld or gba_mb.ld files in your repository. You should delete these when upgrading.
|
||||
|
||||
### Fixed
|
||||
|
||||
|
|
|
@ -3,17 +3,18 @@ use std::{env, error::Error, fs, path::PathBuf};
|
|||
fn main() -> Result<(), Box<dyn Error>> {
|
||||
let out = &PathBuf::from(env::var("OUT_DIR").unwrap());
|
||||
let linker_script = if env::var("CARGO_FEATURE_MULTIBOOT").is_ok() {
|
||||
include_bytes!("gba_mb.ld").as_slice()
|
||||
include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/src/gba_mb.ld")).as_slice()
|
||||
} else {
|
||||
include_bytes!("gba.ld").as_slice()
|
||||
include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/src/gba.ld")).as_slice()
|
||||
};
|
||||
|
||||
fs::write(out.join("gba.ld"), linker_script)?;
|
||||
println!("cargo:rustc-link-search={}", out.display());
|
||||
|
||||
println!("cargo:rerun-if-changed=gba.ld");
|
||||
println!("cargo:rerun-if-changed=gba_mb.ld");
|
||||
println!("cargo:rerun-if-changed=src/gba.ld");
|
||||
println!("cargo:rerun-if-changed=src/gba_mb.ld");
|
||||
println!("cargo:rerun-if-changed=build.rs");
|
||||
println!("cargo:rerun-if-env-changed=CARGO_FEATURE_MULTIBOOT");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
2
justfile
2
justfile
|
@ -146,7 +146,7 @@ _test-debug crate:
|
|||
_test-debug-arm crate:
|
||||
(cd "{{crate}}" && cargo test --target=armv4t-none-eabi)
|
||||
_test-multiboot:
|
||||
(cd "agb" && AGB_MULTIBOOT=true RUSTFLAGS="-Clink-arg=-Tgba_mb.ld -Ctarget-cpu=arm7tdmi" cargo test --test=test_multiboot)
|
||||
(cd "agb" && AGB_MULTIBOOT=true cargo test --features=multiboot --test=test_multiboot)
|
||||
_clippy crate:
|
||||
(cd "{{crate}}" && cargo clippy --examples --tests -- {{CLIPPY_ARGUMENTS}})
|
||||
_clean crate:
|
||||
|
|
Loading…
Reference in a new issue