diff options
| author | hachem <im@hachem.wtf> | 2026-09-02 01:19:50 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-09-02 01:19:50 +0200 |
| commit | ef15ee2b634058a8199c31223e5e2ec9784be031 (patch) | |
| tree | f1b0de7d47a04a26f8c3814e729564d3edef34dc /Makefile | |
| parent | 363c188831bdbd75c5f5cd4ac861e9331adaf1af (diff) | |
setup: project
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..cb5d10d --- /dev/null +++ b/Makefile @@ -0,0 +1,45 @@ +CC := clang + +CFLAGS := -Wall \ + -Wextra \ + -Wpedantic \ + -Wconversion \ + -Wsign-conversion \ + -Wshadow \ + -Wstrict-prototypes \ + -Wmissing-prototypes \ + -g \ + -fno-omit-frame-pointer \ + -fsanitize=address,undefined \ + -std=c17 \ + -Isrc + +LDFLAGS := -fsanitize=address,undefined + +CPPCHECKFLAGS := --project=compile_commands.json \ + --enable=warning,style,performance,portability \ + --error-exitcode=1 + +TARGET := bin/jafm + +SRC := $(shell find src -name '*.c') +OBJ := $(SRC:src/%.c=bin/%.o) + +all: $(TARGET) + +$(TARGET): $(OBJ) + @mkdir -p $(@D) + $(CC) $^ -o $@ $(LDFLAGS) + +bin/%.o: src/%.c + @mkdir -p $(@D) + $(CC) $(CFLAGS) -c $< -o $@ + +check: + bear -- make clean all + cppcheck $(CPPCHECKFLAGS) + +clean: + rm -rf bin + +.PHONY: all check clean |
