2019-05-11 15:32:38 +02:00
|
|
|
use std::env;
|
2020-04-19 18:02:31 +02:00
|
|
|
use std::fs;
|
2019-05-11 15:32:38 +02:00
|
|
|
use std::io::Write;
|
|
|
|
use std::path::PathBuf;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
// Put the linker script somewhere the linker can find it
|
2020-04-19 18:02:31 +02:00
|
|
|
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
|
|
|
|
fs::File::create(out_dir.join("memory.x"))
|
2019-05-11 15:32:38 +02:00
|
|
|
.unwrap()
|
|
|
|
.write_all(include_bytes!("memory.x"))
|
|
|
|
.unwrap();
|
2020-04-19 18:02:31 +02:00
|
|
|
println!("cargo:rustc-link-search={}", out_dir.display());
|
2019-05-11 15:32:38 +02:00
|
|
|
println!("cargo:rerun-if-changed=memory.x");
|
|
|
|
}
|