-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.rs
32 lines (27 loc) · 1010 Bytes
/
build.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use std::env;
use std::process::Command;
fn main() {
let out_dir = env::var("OUT_DIR").unwrap();
Command::new("gcc")
.args(&["src/arch/x86_64/boot.s", "-c", "-mcmodel=large", "-g", "-o"])
.arg(&format!("{}/libboot.a", out_dir))
.status()
.unwrap();
Command::new("gcc")
.args(&["src/arch/x86_64/pm.s", "-c", "-mcmodel=large", "-g", "-o"])
.arg(&format!("{}/libpm.a", out_dir))
.status()
.unwrap();
Command::new("gcc")
.args(&["src/arch/x86_64/isr.s", "-c", "-mcmodel=large", "-g", "-o"])
.arg(&format!("{}/libisr.a", out_dir))
.status()
.unwrap();
println!("cargo:rustc-link-search={}", out_dir);
println!("cargo:rustc-link-lib=boot");
println!("cargo:rustc-link-lib=pm");
println!("cargo:rustc-link-lib=isr");
println!("cargo:rerun-if-changed=src/boot/boot.s");
println!("cargo:rerun-if-changed=src/boot/pm.s");
println!("cargo:rerun-if-changed=src/boot/isr.s");
}