summaryrefslogtreecommitdiff
path: root/kernel/makefile
diff options
context:
space:
mode:
authorBenji Dial <benji@benjidial.net>2024-05-18 21:53:38 -0400
committerBenji Dial <benji@benjidial.net>2024-05-18 21:53:38 -0400
commitb1a912a8a6ff472a49b2e0a09cfd433adfc2cb24 (patch)
tree5009d4415ba13e4baa37f3d0271852528130fd3b /kernel/makefile
parenta8a80d326de9550b2a25b1255a2093ab43219ede (diff)
downloadhilbert-os-b1a912a8a6ff472a49b2e0a09cfd433adfc2cb24.tar.gz
reorganization, cross compiler
Diffstat (limited to 'kernel/makefile')
-rw-r--r--kernel/makefile19
1 files changed, 19 insertions, 0 deletions
diff --git a/kernel/makefile b/kernel/makefile
new file mode 100644
index 0000000..1cb2d52
--- /dev/null
+++ b/kernel/makefile
@@ -0,0 +1,19 @@
+SOURCES = \
+ storage/bd/memory.cpp storage/fs/tarfs.cpp application.asm application.cpp \
+ framebuffer.cpp interrupts.asm interrupts.cpp allocator.cpp storage.cpp \
+ syscall.cpp utility.cpp paging.asm paging.cpp entry.cpp input.cpp panic.cpp \
+ vfile.cpp
+
+build/%.asm.o: source/%.asm
+ @mkdir -p $(@D)
+ $(HILBERT_NASM) $^ -o $@
+
+build/%.cpp.o: source/%.cpp
+ @mkdir -p $(@D)
+ $(HILBERT_CC) -c -ffreestanding -mcmodel=kernel -I ${LIMINE_DIR} $^ -o $@
+
+build/kernel.elf: $(SOURCES:%=build/%.o)
+ $(HILBERT_LD) -T link.ld $^ -o $@
+
+clean:
+ rm -rf build