summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2024-02-03 14:36:26 -0500
committerFreya Murphy <freya@freyacat.org>2024-02-03 14:41:52 -0500
commit8e74123683072deed9ecd29e76037a16a47e3295 (patch)
tree2a4d6394688ed23b9360ff87c8d9861ab40da01d /Makefile
parentrefactor exception panic (diff)
downloadcorn-8e74123683072deed9ecd29e76037a16a47e3295.tar.gz
corn-8e74123683072deed9ecd29e76037a16a47e3295.tar.bz2
corn-8e74123683072deed9ecd29e76037a16a47e3295.zip
alloc on write paging, -O3 compile works, 'volatile' is the story of my life
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 7 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index d8ab7a8..fee6417 100644
--- a/Makefile
+++ b/Makefile
@@ -6,10 +6,12 @@ CC=cc
LD=ld
AS=nasm
-CFLAGS += -std=c2x -ffreestanding -fno-stack-protector -g -Wall -Wextra -pedantic -lgcc -isystem include
+CFLAGS += -std=c2x -ffreestanding -lgcc -isystem include
+CFLAGS += -Wall -Wextra -pedantic
+CFLAGS += -O3 -pipe -g -fno-stack-protector
CFLAGS += -DPAGE_SIZE=4096
-LDFLAGS += -nmagic -nostdlib
+LDFLAGS += -nmagic --no-warn-rwx-segments -nostdlib
H_SRC = $(shell find src include -type f -name "*.h")
@@ -24,6 +26,8 @@ A_OBJ = $(patsubst %.S,build/%.S.o,$(A_SRC))
all: build/$(ISO)
+build: build/$(ISO)
+
clean:
@printf "\033[31m RM \033[0m%s\n" build
@rm -rf build/*
@@ -41,7 +45,7 @@ $(C_OBJ): build/%.o : %.c
build/$(KERNEL): arch/$(ARCH)/linker.ld $(A_OBJ) $(C_OBJ) $(H_SRC)
@mkdir -p $(@D)
@printf "\033[32m LD \033[0m%s\n" $@
- @$(LD) $(LDFLAGS) --no-warn-rwx-segments -T arch/$(ARCH)/linker.ld -o build/$(KERNEL) $(A_OBJ) $(C_OBJ)
+ @$(LD) $(LDFLAGS) -T arch/$(ARCH)/linker.ld -o build/$(KERNEL) $(A_OBJ) $(C_OBJ)
build/$(ISO): build/$(KERNEL) grub.cfg
@mkdir -p $(@D)