summaryrefslogtreecommitdiffhomepage
path: root/Private/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Private/makefile')
-rw-r--r--Private/makefile35
1 files changed, 35 insertions, 0 deletions
diff --git a/Private/makefile b/Private/makefile
new file mode 100644
index 00000000..558811a2
--- /dev/null
+++ b/Private/makefile
@@ -0,0 +1,35 @@
+CC = x86_64-elf-gcc
+LD = x86_64-elf-ld
+CCFLAGS = -c -ffreestanding -fno-rtti -fno-exceptions -std=c++20 -D__HAVE_HCORE_APIS__ -D__hCore__ -I./ -I$(HOME)/
+ASM = nasm
+ASMFLAGS = -f elf64
+
+# This file is the kernel, responsible of task management, memory, drivers and more.
+KERNEL = hKernel.elf
+
+# The kernel entrypoint
+SCRIPT = --script=Linker/AMD64.ld
+
+# we want a flat binary
+FMT = elf64
+
+.PHONY: kernel-build
+kernel-build:
+ $(CC) $(CCFLAGS) Source/*.cxx HALKit/AMD64/PCI/*.cpp Source/Network/*.cpp\
+ Source/Storage/*.cxx HALKit/AMD64/*.cxx HALKit/AMD64/*.cpp HALKit/AMD64/*.s
+ $(ASM) -f elf64 HALKit/AMD64/DebugManager.asm
+ $(ASM) -f elf64 HALKit/AMD64/SMPCoreManager.asm
+ mv *.o HALKit/AMD64/*.o Obj/
+
+.PHONY: kernel-link
+kernel-link:
+ $(LD) $(SCRIPT) Obj/*.o -o $(KERNEL)
+ cp $(KERNEL) Root/System
+
+.PHONY: all
+all: kernel-build kernel-link
+ @echo "[hKernel] JOB DONE."
+
+.PHONY: kernel-clean
+kernel-clean:
+ rm -f Obj/*.o $(KERNEL)