From 0c673a2751ae9381b082ae3e5851f51367938ff1 Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Sun, 22 Jan 2023 12:46:09 +0100 Subject: [PATCH] chore: make lint job check for warnings --- .woodpecker/lint.yml | 1 + Makefile | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.woodpecker/lint.yml b/.woodpecker/lint.yml index 7c0f90e..70feabe 100644 --- a/.woodpecker/lint.yml +++ b/.woodpecker/lint.yml @@ -11,5 +11,6 @@ pipeline: pull: true commands: - make lint + - make CFLAGS='-Werror' when: event: [push, pull_request] diff --git a/Makefile b/Makefile index 777d356..f6ed2d9 100644 --- a/Makefile +++ b/Makefile @@ -25,8 +25,8 @@ INC_FLAGS := $(addprefix -I,$(INC_DIRS)) # object file is also recompiled if only a header is changed. # -MP: generate a dummy target for every header file (according to the docs it # prevents some errors when removing header files) -CFLAGS ?= -MMD -MP -Wall -Wextra -CFLAGS += $(INC_FLAGS) +CFLAGS ?= -MMD -MP +VIETERCFLAGS := $(INC_FLAGS) $(CFLAGS) -Wall -Wextra .PHONY: all all: vieter @@ -40,7 +40,7 @@ $(BUILD_DIR)/$(LIB_FILENAME): $(OBJS) $(BUILD_DIR)/$(SRC_DIR)/%.c.o: $(SRC_DIR)/%.c mkdir -p $(dir $@) - $(CC) $(CFLAGS) -c $< -o $@ + $(CC) $(VIETERCFLAGS) -c $< -o $@ # =====TESTING===== @@ -67,7 +67,7 @@ $(BINS_TEST): %: %.c.o $(OBJS) # exposed. $(BUILD_DIR)/$(TEST_DIR)/%.c.o: $(TEST_DIR)/%.c mkdir -p $(dir $@) - $(CC) $(CFLAGS) -I$(TEST_DIR) \ + $(CC) $(VIETERCFLAGS) -I$(TEST_DIR) \ -I$(dir $(@:$(BUILD_DIR)/$(TEST_DIR)/%=$(SRC_DIR)/%)) \ -c $< -o $@