Make it compile on macOS

master
WangRunji 7 years ago
parent 4ce1ba8f6d
commit 771839f0d7

@ -10,6 +10,14 @@ assembly_source_files := $(wildcard src/arch/$(arch)/*.asm)
assembly_object_files := $(patsubst src/arch/$(arch)/%.asm, \
build/arch/$(arch)/%.o, $(assembly_source_files))
ifeq ($(shell uname), Linux)
prefix :=
else
prefix := x86_64-elf-
endif
ld := $(prefix)ld
.PHONY: all clean run iso kernel
all: $(kernel)
@ -18,7 +26,7 @@ clean:
@rm -r build
run: $(iso)
@qemu-system-x86_64 -cdrom $(iso)
@qemu-system-$(arch) -cdrom $(iso)
iso: $(iso)
@ -30,7 +38,7 @@ $(iso): $(kernel) $(grub_cfg)
@rm -r build/isofiles
$(kernel): kernel $(rust_os) $(assembly_object_files) $(linker_script)
@ld -n --gc-sections -T $(linker_script) -o $(kernel) \
@$(ld) -n --gc-sections -T $(linker_script) -o $(kernel) \
$(assembly_object_files) $(rust_os)
kernel:

Loading…
Cancel
Save