|
|
@ -10,6 +10,14 @@ assembly_source_files := $(wildcard src/arch/$(arch)/*.asm)
|
|
|
|
assembly_object_files := $(patsubst src/arch/$(arch)/%.asm, \
|
|
|
|
assembly_object_files := $(patsubst src/arch/$(arch)/%.asm, \
|
|
|
|
build/arch/$(arch)/%.o, $(assembly_source_files))
|
|
|
|
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
|
|
|
|
.PHONY: all clean run iso kernel
|
|
|
|
|
|
|
|
|
|
|
|
all: $(kernel)
|
|
|
|
all: $(kernel)
|
|
|
@ -18,7 +26,7 @@ clean:
|
|
|
|
@rm -r build
|
|
|
|
@rm -r build
|
|
|
|
|
|
|
|
|
|
|
|
run: $(iso)
|
|
|
|
run: $(iso)
|
|
|
|
@qemu-system-x86_64 -cdrom $(iso)
|
|
|
|
@qemu-system-$(arch) -cdrom $(iso)
|
|
|
|
|
|
|
|
|
|
|
|
iso: $(iso)
|
|
|
|
iso: $(iso)
|
|
|
|
|
|
|
|
|
|
|
@ -30,7 +38,7 @@ $(iso): $(kernel) $(grub_cfg)
|
|
|
|
@rm -r build/isofiles
|
|
|
|
@rm -r build/isofiles
|
|
|
|
|
|
|
|
|
|
|
|
$(kernel): kernel $(rust_os) $(assembly_object_files) $(linker_script)
|
|
|
|
$(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)
|
|
|
|
$(assembly_object_files) $(rust_os)
|
|
|
|
|
|
|
|
|
|
|
|
kernel:
|
|
|
|
kernel:
|
|
|
|