2023-05-28 19:44:47 +02:00
|
|
|
use std::ffi::OsStr;
|
2023-05-28 19:28:21 +02:00
|
|
|
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());
|
2023-05-28 19:44:47 +02:00
|
|
|
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());
|
|
|
|
}
|
|
|
|
}
|
2023-05-28 19:28:21 +02:00
|
|
|
}
|