makefile
来自「从网上下载的一个自己编写的简单的操作系统源代码,对底层了解很有好处的」· 代码 · 共 50 行
TXT
50 行
#
#
#
#
# 负责编译 引导记录 和 setup.bin
#
#
#
setupo = setup.o setup/detectmem.o setup/setupvga.o setup/8259.o
# 此makefile的最终任务
boot:fsector.bin setup.bin
$(CP) fsector.bin ..\build
partcopy setup.bin 0 1 setup.bin 7ff
$(CP) setup.bin ..\build
# 编译引导记录
fsector.bin: fsector.s
$(AS) -o $@ $<
# 编译setup.bin, 有点特殊
setup.bin: $(setupo)
$(LD) $(LDFLG) $(setupo) -Ttext 0x0 -e setup_entry -O binary -o setup.binary
objcopy -R .comment -R .note -S -O binary setup.binary $@
# 默认规则
%.o:%.s
$(AS) -f aout -o $@ $<
#
#
#
clean:
$(RM) *.o
$(RM) *.binary
$(RM) setup\*.o
$(RM) fsector.bin
$(RM) setup.bin
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?