← Back to davo.co
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile16
1 files changed, 15 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 939f257..c2a75fd 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,20 @@
# Compiler and flags
+# Compiler & Language Standard
CC := gcc
-CFLAGS := -Wall -Wextra -Wpedantic -O2 -std=c11 -D_POSIX_C_SOURCE=200809L
+CFLAGS := -std=c11 -D_POSIX_C_SOURCE=200809L
+
+# --- PERFORMANCE FLAGS ---
+CFLAGS += -O3 -flto -fomit-frame-pointer -march=native
+
+# --- SAFETY & STRICT WARNING FLAGS ---
+CFLAGS += -Wall -Wextra -Wpedantic -Werror \
+ -Wconversion -Wsign-conversion -Wshadow -Wformat=2
+
+# --- HARDENING & RUNTIME PROTECTION FLAGS ---
+CFLAGS += -fstack-protector-strong -D_FORTIFY_SOURCE=2
+
+# --- LINKER FLAGS (LTO & Strip) ---
+LDFLAGS := -flto -O3 -Wl,-s
TARGET := ud
SRC := main.c
OBJ := $(SRC:.c=.o)