linux0.00 的Makefile

多任务简单内核实例的Makefile

# Makefile for the simple example kernel.
AS86    =as86 -0 -a
LD86    =ld86 -0
AS    =as --32    # 貌似现在的操作系统, 要编译, 一定记得加 --32, 不然编译会报好多的错误
LD    =ld
LDFLAGS =-m elf_i386 -Ttext 0 -e startup_32 -s -x -M  

all:    Image

Image: boot system
    dd bs=32 if=boot of=Image skip=1
# dd bs=512 if=system of=Image skip=8 seek=1 # 这样写也可以,应该是 system 会有文件头描述信息,跳过去,直接要二进制内容即可
objcopy -O binary system head cat head >> Image disk: Image dd bs=8192 if=Image of=/dev/fd0 sync;sync;sync head.o: head.s system: head.o $(LD) $(LDFLAGS) head.o -o system > System.map boot: boot.s $(AS86) -o boot.o boot.s $(LD86) -s -o boot boot.o clean: rm -f Image System.map core boot head *.o system
原文地址:https://www.cnblogs.com/davytitan/p/12101134.html