]> git.dujemihanovic.xyz Git - nameless-os.git/commitdiff
kernel: Move source files out of kernel/ directory
authorDuje Mihanović <duje.mihanovic@skole.hr>
Fri, 1 Jul 2022 19:57:39 +0000 (21:57 +0200)
committerDuje Mihanović <duje.mihanovic@skole.hr>
Fri, 1 Jul 2022 20:04:10 +0000 (22:04 +0200)
Also alphabetically sort the includes in kernel/Makefile for extra tidiness.

kernel/Makefile
kernel/arch/x86/Makefile
kernel/arch/x86/entry.s [moved from kernel/entry.s with 100% similarity]
kernel/arch/x86/linker.ld [moved from kernel/linker.ld with 100% similarity]
kernel/kernel/Makefile [new file with mode: 0644]
kernel/kernel/kernel.c [moved from kernel/kernel.c with 100% similarity]

index 48115dd74f927a8246a1ec9edc2804a482350682..821e4942fbe3efb630685a8cfc271212606255c3 100644 (file)
@@ -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
index 52224a3a154f6c5eed329587449b7c7a1544c690..b164c9d17c4cfbc309f12e05215bae428b7e26a9 100644 (file)
@@ -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)
similarity index 100%
rename from kernel/entry.s
rename to kernel/arch/x86/entry.s
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 (file)
index 0000000..8716875
--- /dev/null
@@ -0,0 +1 @@
+KERNEL_OBJ += kernel/kernel.o
similarity index 100%
rename from kernel/kernel.c
rename to kernel/kernel/kernel.c