feat: rerun build if linker script changes
This commit is contained in:
@@ -66,7 +66,7 @@ endif
|
||||
all: kernel initrd
|
||||
|
||||
kernel:
|
||||
cd kernel && cargo build $(CARGO_BUILD_OPTS)
|
||||
cd kernel && ARCH=$(ARCH) MACH=$(MACH) cargo build $(CARGO_BUILD_OPTS)
|
||||
ifeq ($(ARCH),aarch64)
|
||||
$(LLVM_BASE)/llvm-strip -o $(O)/kernel.strip $(O)/kernel
|
||||
$(LLVM_BASE)/llvm-size $(O)/kernel.strip
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
use std::env;
|
||||
|
||||
fn main() -> Result<(), i32> {
|
||||
let arch = env::var("ARCH").expect("$ARCH is not set");
|
||||
let mach = if arch == "aarch64" {
|
||||
env::var("MACH").expect("$MACH is not set")
|
||||
} else {
|
||||
"none".to_owned()
|
||||
};
|
||||
println!("cargo:rerun-if-changed=../etc/{}-{}.ld", arch, mach);
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user