mirror of
https://github.com/laanwj/k210-sdk-stuff.git
synced 2024-11-22 17:36:20 +04:00
b6b5d13b0c
really want to handle UART interrupts so this needs PLIC and dispatching but this is a start…
14 lines
424 B
Rust
14 lines
424 B
Rust
use std::{env, fs};
|
|
use std::path::PathBuf;
|
|
use std::io::Write;
|
|
|
|
fn main() {
|
|
// Put the linker script somewhere the linker can find it
|
|
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
|
|
println!("cargo:rustc-link-search={}", out_dir.display());
|
|
|
|
fs::File::create(out_dir.join("trap.x")).unwrap()
|
|
.write_all(include_bytes!("trap.x")).unwrap();
|
|
println!("cargo:rerun-if-changed=trap.x");
|
|
}
|