⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 makefile

📁 于渊《自己动手写操作系统》源代码及相关工具
💻
字号:
####################### Makefile for Tinix ######################## Entry point of Tinix# It must be as same as 'KernelEntryPointPhyAddr' in load.inc!!!ENTRYPOINT	= 0x30400# Offset of entry point in kernel file# It depends on ENTRYPOINTENTRYOFFSET	=   0x400# Programs, flags, etc.ASM		= nasmDASM		= ndisasmCC		= gccLD		= ldASMBFLAGS	= -I boot/includeASMKFLAGS	= -I include -f elfCFLAGS		= -I include -c -fno-builtinLDFLAGS		= -s -Ttext $(ENTRYPOINT)DASMFLAGS	= -u -o $(ENTRYPOINT) -e $(ENTRYOFFSET)# This ProgramTINIXBOOT	= boot/boot.bin boot/loader.binTINIXKERNEL	= kernel.binOBJS		= kernel/kernel.o kernel/start.o kernel/main.o\			kernel/i8259.o kernel/global.o kernel/protect.o\			lib/klib.o lib/klibc.o lib/string.oDASMOUTPUT	= kernel.bin.asm# All Phony Targets.PHONY : everything final image clean realclean disasm all buildimg# Default starting positioneverything : $(TINIXBOOT) $(TINIXKERNEL)all : realclean everythingfinal : all cleanimage : final buildimgclean :	rm -f $(OBJS)realclean :	rm -f $(OBJS) $(TINIXBOOT) $(TINIXKERNEL)disasm :	$(DASM) $(DASMFLAGS) $(TINIXKERNEL) > $(DASMOUTPUT)# Write "boot.bin" & "loader.bin" into floppy image "TINIX.IMG"# We assume that "TINIX.IMG" exists in current folderbuildimg :	mount TINIX.IMG /mnt/floppy -o loop	cp -f boot/loader.bin /mnt/floppy/	cp -f kernel.bin /mnt/floppy	umount  /mnt/floppyboot/boot.bin : boot/boot.asm boot/include/load.inc boot/include/fat12hdr.inc	$(ASM) $(ASMBFLAGS) -o $@ $<boot/loader.bin : boot/loader.asm boot/include/load.inc boot/include/fat12hdr.inc boot/include/pm.inc	$(ASM) $(ASMBFLAGS) -o $@ $<$(TINIXKERNEL) : $(OBJS)	$(LD) $(LDFLAGS) -o $(TINIXKERNEL) $(OBJS)kernel/kernel.o : kernel/kernel.asm include/sconst.inc	$(ASM) $(ASMKFLAGS) -o $@ $<kernel/start.o: kernel/start.c include/type.h include/const.h include/protect.h include/string.h include/proc.h include/proto.h \			include/global.h	$(CC) $(CFLAGS) -o $@ $<kernel/main.o: kernel/main.c include/type.h include/const.h include/protect.h include/string.h include/proc.h include/proto.h \			include/global.h	$(CC) $(CFLAGS) -o $@ $<kernel/i8259.o: kernel/i8259.c include/type.h include/const.h include/protect.h include/proto.h	$(CC) $(CFLAGS) -o $@ $<kernel/global.o: kernel/global.c include/type.h include/const.h include/protect.h include/proc.h \			include/global.h include/proto.h	$(CC) $(CFLAGS) -o $@ $<kernel/protect.o: kernel/protect.c include/type.h include/const.h include/protect.h include/proc.h include/proto.h \			include/global.h	$(CC) $(CFLAGS) -o $@ $<lib/klibc.o: lib/klib.c include/type.h include/const.h include/protect.h include/string.h include/proc.h include/proto.h \			include/global.h	$(CC) $(CFLAGS) -o $@ $<lib/klib.o : lib/klib.asm	$(ASM) $(ASMKFLAGS) -o $@ $<lib/string.o : lib/string.asm	$(ASM) $(ASMKFLAGS) -o $@ $<

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -