diff --git a/Makefile b/Makefile index 454d611..b3163d4 100644 --- a/Makefile +++ b/Makefile @@ -31,6 +31,7 @@ endif ld := $(prefix)ld objdump := $(prefix)objdump +cc := $(prefix)gcc .PHONY: all clean run iso kernel build debug_asm @@ -61,7 +62,7 @@ $(kernel): kernel $(rust_os) $(assembly_object_files) $(linker_script) $(assembly_object_files) $(rust_os) kernel: - @RUST_TARGET_PATH=$(shell pwd) xargo build --target $(target) --features "$(features)" + @RUST_TARGET_PATH=$(shell pwd) CC=$(cc) xargo build --target $(target) --features "$(features)" # compile assembly files build/arch/$(arch)/boot/%.o: $(boot_src)/%.asm diff --git a/build.rs b/build.rs index add2486..f1fd01a 100644 --- a/build.rs +++ b/build.rs @@ -1,16 +1,7 @@ extern crate cc; -use std::process::Command; fn main() { - let output = Command::new("uname").output() - .expect("failed to get uname"); - let compiler = match output.stdout.as_slice() { - b"Darwin\n" => "x86_64-elf-gcc", - b"Linux\n" => "gcc", - _ => panic!("unknown os") - }; cc::Build::new() - .compiler(compiler) .file("src/arch/x86_64/driver/apic/lapic.c") .compile("cobj"); } \ No newline at end of file