summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2025-04-19 16:36:51 -0400
committerFreya Murphy <freya@freyacat.org>2025-04-19 16:37:54 -0400
commit472ec944d2ed81d0304cc6cac80946a6a44776be (patch)
treef6cae641c143a0b45bb289d9d9fc6145706025b0 /Makefile
parentset mmap limit (diff)
downloadcomus-472ec944d2ed81d0304cc6cac80946a6a44776be.tar.gz
comus-472ec944d2ed81d0304cc6cac80946a6a44776be.tar.bz2
comus-472ec944d2ed81d0304cc6cac80946a6a44776be.zip
UEFI and republicans
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 9 insertions, 2 deletions
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/*")