From: Duje Mihanović Date: Fri, 1 Jul 2022 19:57:39 +0000 (+0200) Subject: kernel: Move source files out of kernel/ directory X-Git-Url: https://git.dujemihanovic.xyz/%7B%7B%20%24style.Permalink%20%7D%7D?a=commitdiff_plain;h=2fe1e5020baffbec00f48fe56bfce0d9860a9ee1;p=nameless-os.git kernel: Move source files out of kernel/ directory Also alphabetically sort the includes in kernel/Makefile for extra tidiness. --- diff --git a/kernel/Makefile b/kernel/Makefile index 48115dd..821e494 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -1,16 +1,15 @@ -KERNEL_OBJ = kernel.o entry.o - -include drivers/Makefile include arch/x86/Makefile +include drivers/Makefile +include kernel/Makefile ASFLAGS_BASE = -f elf -g dwarf2 CFLAGS_BASE = -fgnu89-inline -ffreestanding -nostdlib -Iinclude \ -Iinclude/arch/x86 -g -DGIT_COMMIT=\"$(GIT_REV)\" \ -O2 -flto -LDFLAGS_BASE = -ffreestanding -nostdlib -lgcc -g -flto +LDFLAGS_BASE = -ffreestanding -nostdlib -lgcc -g -flto -T arch/x86/linker.ld kernel.elf kernel.dbg: $(KERNEL_OBJ) - $(REAL_CC) $(LDFLAGS_BASE) $(LDFLAGS) -T linker.ld $^ -o $@ + $(REAL_CC) $(LDFLAGS_BASE) $(LDFLAGS) $^ -o $@ $(CROSS_COMPILE)objcopy --only-keep-debug kernel.elf kernel.dbg $(CROSS_COMPILE)objcopy --add-gnu-debuglink=kernel.dbg kernel.elf $(CROSS_COMPILE)strip --strip-unneeded kernel.elf diff --git a/kernel/arch/x86/Makefile b/kernel/arch/x86/Makefile index 52224a3..b164c9d 100644 --- a/kernel/arch/x86/Makefile +++ b/kernel/arch/x86/Makefile @@ -1,4 +1,4 @@ include arch/x86/irq/Makefile include arch/x86/tty/Makefile -KERNEL_OBJ += arch/x86/halt.o +KERNEL_OBJ += $(addprefix arch/x86/, entry.o halt.o) diff --git a/kernel/entry.s b/kernel/arch/x86/entry.s similarity index 100% rename from kernel/entry.s rename to kernel/arch/x86/entry.s diff --git a/kernel/linker.ld b/kernel/arch/x86/linker.ld similarity index 100% rename from kernel/linker.ld rename to kernel/arch/x86/linker.ld diff --git a/kernel/kernel/Makefile b/kernel/kernel/Makefile new file mode 100644 index 0000000..8716875 --- /dev/null +++ b/kernel/kernel/Makefile @@ -0,0 +1 @@ +KERNEL_OBJ += kernel/kernel.o diff --git a/kernel/kernel.c b/kernel/kernel/kernel.c similarity index 100% rename from kernel/kernel.c rename to kernel/kernel/kernel.c