KERNEL_OBJ = kernel/entry.o kernel/arch/x86/tty/tty.o kernel/kernel.o
-all: boot.img
+all: boot.img kernel/kernel.elf
boot.img: boot/x86/boot kernel/kernel.bin
cat boot/x86/boot kernel/kernel.bin > $@
$(AS) -f bin boot/x86/boot.s -o $@
kernel/kernel.bin: ${KERNEL_OBJ}
- $(LD) -o $@ -T kernel/linker.ld ${KERNEL_OBJ} --oformat=binary
+ $(LD) -o $@ -T kernel/linker.ld ${KERNEL_OBJ}
kernel/entry.o: kernel/entry.s
$(AS) -f elf kernel/entry.s -o $@
kernel/kernel.o: kernel/kernel.c
$(CC) -g -o $@ -Iinclude/arch/x86 -ffreestanding -c kernel/kernel.c
+kernel/kernel.elf: kernel/kernel.bin
+ $(LD) -o $@ -T kernel/linker.ld ${KERNEL_OBJ} --oformat=elf32-i386
+
clean:
rm boot/x86/boot kernel/kernel.bin ${KERNEL_OBJ} boot.img