hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile38
1 files changed, 38 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..b98c49f
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,38 @@
+CC := clang
+SANITIZE ?= 1
+
+CFLAGS := -g \
+ -Wall \
+ -Wextra \
+ -Wshadow \
+ -Wpedantic \
+ -std=c17 \
+ -Wconversion \
+ -Wstrict-prototypes \
+ -Wsign-conversion \
+ -Wmissing-prototypes \
+ -fno-omit-frame-pointer
+
+ifeq ($(SANITIZE),1)
+CFLAGS += -fsanitize=address,undefined
+LDFLAGS += -fsanitize=address,undefined
+endif
+
+TARGET := mkproj
+SRC := mkproj.c
+
+all: $(TARGET)
+
+$(TARGET): $(SRC)
+ $(CC) $(CFLAGS) $< -o $@ $(LDFLAGS)
+
+check:
+ bear -- make clean all
+ cppcheck --enable=warning,style,performance,portability \
+ --project=compile_commands.json \
+ --error-exitcode=1
+
+clean:
+ rm -f $(TARGET)
+
+.PHONY: all check clean