aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorBobby <[email protected]>2025-11-24 17:54:50 +0530
committerBobby <[email protected]>2025-11-27 14:44:10 +0530
commit95a31021567d24a8fc9f397ec278f0b4da244470 (patch)
tree24c3a84a5debcbd5f7adc20c09a0fb9b6887b42a /Makefile
parentf471a7e865a1b530a2177d6ab49f157df9716db7 (diff)
downloadakiba-95a31021567d24a8fc9f397ec278f0b4da244470.tar.xz
akiba-95a31021567d24a8fc9f397ec278f0b4da244470.zip
framebuffer working with grub UEFI boot
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile46
1 files changed, 46 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..9479982
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,46 @@
+.PHONY: all clean run
+
+# Source files
+KERNEL_SOURCE = mirai/mirai.zig
+BOOT_ASM = boot/boot.s
+LINKER_SCRIPT = linker/mirai.linker
+GRUB_CONFIG = boot/grub/grub.cfg
+
+# Build directories
+BUILD_DIR = iso/build
+ISO_DIR = iso/akiba
+ISO_OUTPUT = iso/akiba.iso
+
+# Build artifacts
+KERNEL_OBJ = $(BUILD_DIR)/mirai/mirai.o
+BOOT_OBJ = $(BUILD_DIR)/boot/boot.o
+KERNEL_OUTPUT = $(ISO_DIR)/system/akiba/mirai.akibakernel
+
+# Tools
+ZIG = zig
+GRUB_MKRESCUE = x86_64-elf-grub-mkrescue
+
+all: $(ISO_OUTPUT)
+
+$(ISO_OUTPUT): $(KERNEL_OUTPUT)
+ mkdir -p $(ISO_DIR)/boot/grub
+ cp $(GRUB_CONFIG) $(ISO_DIR)/boot/grub/
+ $(GRUB_MKRESCUE) -o $(ISO_OUTPUT) $(ISO_DIR)
+
+$(KERNEL_OUTPUT): $(KERNEL_OBJ) $(BOOT_OBJ)
+ mkdir -p $(dir $(KERNEL_OUTPUT))
+ $(ZIG) build-exe $(BOOT_OBJ) $(KERNEL_OBJ) -target x86_64-freestanding -femit-bin=$(KERNEL_OUTPUT) -T $(LINKER_SCRIPT) --name mirai
+
+$(KERNEL_OBJ): $(KERNEL_SOURCE)
+ mkdir -p $(dir $(KERNEL_OBJ))
+ $(ZIG) build-obj $(KERNEL_SOURCE) -target x86_64-freestanding -femit-bin=$(KERNEL_OBJ)
+
+$(BOOT_OBJ): $(BOOT_ASM)
+ mkdir -p $(dir $(BOOT_OBJ))
+ $(ZIG) build-obj $(BOOT_ASM) -target x86_64-freestanding -femit-bin=$(BOOT_OBJ)
+
+clean:
+ rm -rf iso/
+
+run: $(ISO_OUTPUT)
+ ./scripts/run.sh \ No newline at end of file