2020301918-os/boot/Makefrag
2022-10-18 18:23:01 +08:00

29 lines
672 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#
# makefile的boot部分
# 将会导入到根目录的makefile文件
#
OBJDIRS += boot
LOADER_OBJS := $(OBJDIR)/boot/loader.o $(OBJDIR)/boot/loadkernel.o
LOADER_LINKER := boot/linker.ld
$(OBJDIR)/boot/%.o: boot/%.c $(OBJDIR)/.vars.CFLAGS
@echo + cc $<
@mkdir -p $(@D)
@$(CC) $(CFLAGS) -c -o $@ $<
$(OBJDIR)/boot/%.o: boot/%.asm
@echo + as obj $<
@mkdir -p $(@D)
@$(AS) -f elf -o $@ $<
$(OBJDIR)/boot/boot.bin: boot/boot.asm
@echo + as bin $<
@mkdir -p $(@D)
@$(AS) -o $@ $<
$(OBJDIR)/boot/loader.bin: $(LOADER_OBJS) $(LOADER_LINKER) $(OBJDIR)/.vars.LDFLAGS
@echo + ld $@
@$(LD) $(LDFLAGS) -s -T $(LOADER_LINKER) --oformat binary -o $@ $(LOADER_OBJS)