bussy/stage1/build.rs
2023-05-28 19:44:47 +02:00

19 lines
629 B
Rust

use std::ffi::OsStr;
use std::path::Path;
fn main() {
let manifest_dir = Path::new(env!("CARGO_MANIFEST_DIR"));
let ld_script_path = manifest_dir.join("stage1.ld");
println!("cargo:rustc-link-arg=--script={}", ld_script_path.display());
println!("cargo:rerun-if-changed={}", ld_script_path.display());
let asm_dir = manifest_dir.join("src").join("asm");
let files = asm_dir.read_dir().unwrap();
for entry in files {
let path = entry.unwrap().path();
if path.extension() == Some(OsStr::new("s")) {
println!("cargo:rerun-if-changed={}", path.display());
}
}
}