diff --git a/Makefile b/Makefile index b0b626d5..7c5d87de 100644 --- a/Makefile +++ b/Makefile @@ -13,10 +13,11 @@ # limitations under the License. arch ?= x86_64 +target ?= $(arch)-unknown-linux-gnu kernel := build/kernel-$(arch).bin iso := build/os-$(arch).iso -rust_os := target/debug/libblog_os.a +rust_os := target/$(target)/debug/libblog_os.a linker_script := src/arch/$(arch)/linker.ld grub_cfg := src/arch/$(arch)/grub.cfg assembly_source_files := $(wildcard src/arch/$(arch)/*.asm) @@ -47,7 +48,7 @@ $(kernel): cargo $(rust_os) $(assembly_object_files) $(linker_script) @ld -n --gc-sections -T $(linker_script) -o $(kernel) $(assembly_object_files) $(rust_os) cargo: - @cargo rustc -- -Z no-landing-pads + @cargo rustc --target $(target) -- -Z no-landing-pads # compile assembly files build/arch/$(arch)/%.o: src/arch/$(arch)/%.asm