2023-03-04 04:37:13 +00:00
|
|
|
use std::error::Error;
|
|
|
|
use std::path::PathBuf;
|
|
|
|
use std::{env, fs};
|
|
|
|
|
|
|
|
fn main() -> Result<(), Box<dyn Error>> {
|
|
|
|
let out = PathBuf::from(env::var("OUT_DIR").unwrap());
|
2024-01-05 12:58:57 +00:00
|
|
|
fs::write(out.join("link_ram.x"), include_bytes!("../link_ram_cortex_m.x")).unwrap();
|
2023-03-04 04:37:13 +00:00
|
|
|
println!("cargo:rustc-link-search={}", out.display());
|
|
|
|
println!("cargo:rerun-if-changed=link_ram.x");
|
|
|
|
|
|
|
|
println!("cargo:rustc-link-arg-bins=--nmagic");
|
|
|
|
println!("cargo:rustc-link-arg-bins=-Tlink_ram.x");
|
|
|
|
println!("cargo:rustc-link-arg-bins=-Tdefmt.x");
|
2023-05-29 22:10:36 +00:00
|
|
|
println!("cargo:rustc-link-arg-bins=-Tteleprobe.x");
|
2023-03-04 04:37:13 +00:00
|
|
|
|
|
|
|
Ok(())
|
|
|
|
}
|