Skip to content
Snippets Groups Projects
Commit e95a4c50 authored by Joakim Nohlgård's avatar Joakim Nohlgård
Browse files

make: Build with -Werror by default

Can be overridden from the environment by setting WERROR=0

also remove reversed logic for Werror in Makefile.buildtest
(a typo caused Werror to be always enabled for all builds)
parent 88a81a37
No related branches found
No related tags found
No related merge requests found
......@@ -31,11 +31,6 @@ endif
info-buildsizes-diff info-build info-boards-supported \
info-features-missing info-boards-features-missing
# Make buildtests error out on warnings by adding -Werror
ifeq (, $(filter buildtest, $(MAKECMDGOALS)))
CFLAGS+=-Werror
endif
ifeq ($(BUILD_IN_DOCKER),1)
buildtest: ..in-docker-container
else
......@@ -63,6 +58,7 @@ buildtest:
BINDIRBASE=$${BINDIRBASE} \
RIOTNOLINK=$${RIOTNOLINK} \
RIOT_VERSION=$${RIOT_VERSION} \
WERROR=$${WERROR} \
$(MAKE) -j$(NPROC) 2>&1) ; \
if [ "$${?}" = "0" ]; then \
${COLOR_ECHO} "${COLOR_GREEN}success${COLOR_RESET}"; \
......
......@@ -50,6 +50,7 @@ export DOCKER_ENV_VARS = \
OFLAGS \
PREFIX \
QUIET \
WERROR \
RIOT_VERSION \
SCANBUILD_ARGS \
SCANBUILD_OUTPUTDIR \
......
......@@ -64,10 +64,17 @@ else
endif
ifeq ($(QUIET),1)
AD=@
MAKEFLAGS += --no-print-directory
AD=@
MAKEFLAGS += --no-print-directory
else
AD=
AD=
endif
# Fail on warnings. Can be overridden by `make WERROR=0`.
WERROR ?= 1
export WERROR
ifeq ($(WERROR),1)
CFLAGS += -Werror
endif
ifneq (10,$(if ${RIOT_VERSION},1,0)$(if ${__RIOTBUILD_FLAG},1,0))
......
......@@ -25,6 +25,7 @@ SCANBUILD_ENV_VARS := \
PATH \
PREFIX \
QUIET \
WERROR \
RIOT_VERSION \
SIZE \
TOOLCHAIN \
......
......@@ -37,6 +37,7 @@ export OBJCOPY # The command used to create the HEXFILE.
export OFLAGS # The parameter for OBJCOPY, e.g. to strip the debug information.
export SIZE # The command to read to size of the ELF sections.
export UNDEF # Set by the BOARD's and CPU's Makefile.include, this contains object files with must not be used in the ELFFILE even if the if no call to the functions.
export WERROR # Treat all compiler warnings as errors if set to 1 (see -Werror flag in GCC manual)
export FLASHER # The command to call on "make flash".
export FFLAGS # The parameters to supply to FLASHER.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment