17 lines
580 B
Rust
17 lines
580 B
Rust
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());
|
|
fs::write(out.join("memory.x"), include_bytes!("memory.x")).unwrap();
|
|
println!("cargo:rustc-link-search={}", out.display());
|
|
println!("cargo:rerun-if-changed=memory.x");
|
|
|
|
println!("cargo:rustc-link-arg-bins=--nmagic");
|
|
println!("cargo:rustc-link-arg-bins=-Tlink.x");
|
|
println!("cargo:rustc-link-arg-bins=-Tdefmt.x");
|
|
println!("cargo:rustc-link-arg-bins=-Tteleprobe.x");
|
|
|
|
Ok(())
|
|
}
|