From 0f7fbc5850030bc209973f2b54c023876a9d9562 Mon Sep 17 00:00:00 2001 From: Alex Denes Date: Sun, 22 Aug 2021 20:23:43 +0000 Subject: [PATCH] Error on non-debug build and add EXTRA_CFLAGS --- Makefile | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 65daddd..dc76c4e 100644 --- a/Makefile +++ b/Makefile @@ -2,13 +2,22 @@ include config.mk include sources.mk ifeq (${CC},clang) + CFLAGS =\ -std=c99\ -Weverything\ -Wno-padded\ -Wno-disabled-macro-expansion\ -pedantic + +ifeq (${DEBUG},1) +CFLAGS += -g +else +CFLAGS += -O2 -Werror +endif + else ifeq (${CC},gcc) + CFLAGS =\ -std=c99\ -Wall\ @@ -27,14 +36,16 @@ CFLAGS =\ -Wunsafe-loop-optimizations\ -Wparentheses\ -pedantic -endif ifeq (${DEBUG},1) CFLAGS += -g else -CFLAGS += -O2 +CFLAGS += -O2 -Werror endif +endif +CFLAGS += ${EXTRA_CFLAGS} + OBJ = ${SRC:.c=.o} all: ${OBJ}