2017-08-07 17:54:25 +08:00
|
|
|
extern crate walkdir;
|
|
|
|
|
2017-05-04 17:35:26 +08:00
|
|
|
use std::env;
|
|
|
|
use std::io::Write;
|
2017-08-07 17:54:25 +08:00
|
|
|
use std::fs::File;
|
2019-10-31 02:55:15 +08:00
|
|
|
use std::path::PathBuf;
|
2017-08-07 17:54:25 +08:00
|
|
|
|
|
|
|
fn linker_script() {
|
2017-05-04 17:35:26 +08:00
|
|
|
// Put the linker script somewhere the linker can find it
|
|
|
|
let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap());
|
|
|
|
File::create(out.join("memory.x"))
|
|
|
|
.unwrap()
|
|
|
|
.write_all(include_bytes!("memory.x"))
|
|
|
|
.unwrap();
|
|
|
|
println!("cargo:rustc-link-search={}", out.display());
|
|
|
|
|
|
|
|
println!("cargo:rerun-if-changed=memory.x");
|
|
|
|
}
|
2017-08-07 17:54:25 +08:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
linker_script();
|
|
|
|
}
|