hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-09-02 17:49:14 +0200
committerhachem <im@hachem.wtf>2026-09-02 17:49:14 +0200
commitc13a55b6738fea1f1b6b5bf78d422836dea3fe71 (patch)
tree301c27a5e7a00011dba89529a7f35780cb58e8a4 /Makefile
parent4822960cb3249a780451a6a9362b4dd5f3be2a3c (diff)
feat: optimization and PARALLELIZATIONNN
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile51
1 files changed, 33 insertions, 18 deletions
diff --git a/Makefile b/Makefile
index 812ee65..e7526ed 100644
--- a/Makefile
+++ b/Makefile
@@ -1,24 +1,35 @@
CC := clang
-CFLAGS := -Wall \
- -Wextra \
- -Wpedantic \
- -Wconversion \
- -Wsign-conversion \
- -Wshadow \
- -Wstrict-prototypes \
- -Wmissing-prototypes \
- -g \
- -fno-omit-frame-pointer \
- -fsanitize=address,undefined \
+WARNINGS := -Wall -Wextra \
+ -Wshadow -Wpedantic \
+ -Wconversion \
+ -Wstrict-prototypes \
+ -Wmissing-prototypes \
+ -Wsign-conversion
+
+CFLAGS := $(WARNINGS) \
+ -O2 \
+ -pthread \
-std=c17
-LDFLAGS := -fsanitize=address,undefined \
- -lz
+LDFLAGS := -lz \
+ -pthread
+
+DEBUGFLAGS := $(WARNINGS) \
+ -g \
+ -O0 \
+ -pthread \
+ -std=c17 \
+ -fno-omit-frame-pointer \
+ -fsanitize=address,undefined
+
+DEBUGLDFLAGS := -lz \
+ -pthread \
+ -fsanitize=address,undefined
-CPPCHECKFLAGS := --project=compile_commands.json \
- --enable=warning,style,performance,portability \
- --error-exitcode=1
+CPPCHECKFLAGS := --error-exitcode=1 \
+ --project=compile_commands.json \
+ --enable=warning,style,performance,portability
TARGET := jafm
SRC := jafm.c
@@ -28,11 +39,15 @@ all: $(TARGET)
$(TARGET): $(SRC)
$(CC) $(CFLAGS) $(SRC) -o $@ $(LDFLAGS)
+debug: $(SRC)
+ $(CC) $(DEBUGFLAGS) $(SRC) -o $(TARGET) $(DEBUGLDFLAGS)
+
check:
- bear -- make clean all
+ bear -- make clean debug
cppcheck $(CPPCHECKFLAGS)
clean:
rm -rf $(TARGET) $(TARGET).dSYM
-.PHONY: all check clean
+.PHONY: all debug check clean
+