[make] add build switch to set -Werror in compile steps
@@ -59,12 +59,16 @@ GLOBAL_COMPILEFLAGS := -g -finline -include $(CONFIGHEADER)
GLOBAL_COMPILEFLAGS += -W -Wall -Wno-multichar -Wno-unused-parameter -Wno-unused-function -Wno-unused-label -Werror=return-type -Wno-nonnull-compare
GLOBAL_COMPILEFLAGS += -fno-common
GLOBAL_CFLAGS := --std=gnu11 -Werror-implicit-function-declaration -Wstrict-prototypes -Wwrite-strings
-#GLOBAL_CFLAGS += -Werror
GLOBAL_CPPFLAGS := --std=c++11 -fno-exceptions -fno-rtti -fno-threadsafe-statics
#GLOBAL_CPPFLAGS += -Weffc++
GLOBAL_ASMFLAGS := -DASSEMBLY
GLOBAL_LDFLAGS :=
+# if WERROR is set, add to the compile args
+ifeq (true,$(call TOBOOL,$(WERROR)))
+GLOBAL_COMPILEFLAGS += -Werror
+endif
+
GLOBAL_LDFLAGS += $(addprefix -L,$(LKINC))
# Architecture specific compile flags
