From bd3dace0ab739f22bce14d7a9f11ca5e0d35dbe7 Mon Sep 17 00:00:00 2001 From: sbosse Date: Mon, 14 Oct 2024 23:07:12 +0200 Subject: [PATCH] Mon 14 Oct 23:06:38 CEST 2024 --- kernel/Makefile | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 kernel/Makefile diff --git a/kernel/Makefile b/kernel/Makefile new file mode 100644 index 0000000..c73677a --- /dev/null +++ b/kernel/Makefile @@ -0,0 +1,27 @@ +include ../Makefile.config + +KERNEL_OBJECTS=kernelcore.o main.o console.o page.o keyboard.o mouse.o event_queue.o clock.o interrupt.o kmalloc.o pic.o ata.o cdromfs.o string.o bitmap.o graphics.o font.o syscall_handler.o process.o mutex.o list.o pagetable.o rtc.o kshell.o fs.o hash_set.o diskfs.o serial.o elf.o device.o kobject.o pipe.o bcache.o printf.o is_valid.o window.o + +basekernel.img: bootblock kernel + cat bootblock kernel /dev/zero | head -c 1474560 > basekernel.img + +kernel: kernel.elf + ${OBJCOPY} -O binary $< $@ + +bootblock: bootblock.elf + ${OBJCOPY} -O binary $< $@ + +kernel.elf: ${KERNEL_OBJECTS} + ${LD} ${KERNEL_LDFLAGS} -Ttext 0x10000 ${KERNEL_OBJECTS} -o $@ + +bootblock.elf: bootblock.o + ${LD} ${KERNEL_LDFLAGS} -Ttext 0 $< -o $@ + +%.o: %.c + ${CC} ${KERNEL_CCFLAGS} -I ../include $< -o $@ + +%.o: %.S + ${CC} ${KERNEL_CCFLAGS} -I ../include $< -o $@ + +clean: + rm -rf basekernel.img *.o *.elf kernel bootblock bootblock.o