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