From 472ec944d2ed81d0304cc6cac80946a6a44776be Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Sat, 19 Apr 2025 16:36:51 -0400 Subject: UEFI and republicans --- Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 0faeee0..64313f1 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ CPP ?= cpp CPPFLAGS += -Ikernel/include -CFLAGS += -O0 +CFLAGS += -O2 CFLAGS += -std=c11 CFLAGS += -Wall -Wextra -pedantic CFLAGS += -fno-pie -fno-stack-protector @@ -42,6 +42,13 @@ QEMUOPTS = -cdrom $(BIN)/$(ISO) \ -m 4G \ -name kern +GRUB = grub-mkrescue + +ifdef UEFI +QEMU = qemu-system-x86_64-uefi +GRUB = grub-mkrescue-uefi +endif + qemu: $(BIN)/$(ISO) $(QEMU) $(QEMUOPTS) @@ -88,7 +95,7 @@ $(BIN)/$(ISO): $(BIN)/$(KERNEL) mkdir -p $(BIN)/iso/boot/grub cp config/grub.cfg $(BIN)/iso/boot/grub cp $(BIN)/$(KERNEL) $(BIN)/iso/boot - grub-mkrescue -o $(BIN)/$(ISO) bin/iso 2>/dev/null + $(GRUB) -o $(BIN)/$(ISO) bin/iso 2>/dev/null fmt: clang-format -i $(shell find -type f -name "*.[ch]" -and -not -path "./kernel/old/*") -- cgit v1.2.3-freya