summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
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)