mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-17 04:52:59 +01:00
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)
This commit is contained in:
parent
88a81a3753
commit
e95a4c50a9
@ -31,11 +31,6 @@ endif
|
|||||||
info-buildsizes-diff info-build info-boards-supported \
|
info-buildsizes-diff info-build info-boards-supported \
|
||||||
info-features-missing info-boards-features-missing
|
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)
|
ifeq ($(BUILD_IN_DOCKER),1)
|
||||||
buildtest: ..in-docker-container
|
buildtest: ..in-docker-container
|
||||||
else
|
else
|
||||||
@ -63,6 +58,7 @@ buildtest:
|
|||||||
BINDIRBASE=$${BINDIRBASE} \
|
BINDIRBASE=$${BINDIRBASE} \
|
||||||
RIOTNOLINK=$${RIOTNOLINK} \
|
RIOTNOLINK=$${RIOTNOLINK} \
|
||||||
RIOT_VERSION=$${RIOT_VERSION} \
|
RIOT_VERSION=$${RIOT_VERSION} \
|
||||||
|
WERROR=$${WERROR} \
|
||||||
$(MAKE) -j$(NPROC) 2>&1) ; \
|
$(MAKE) -j$(NPROC) 2>&1) ; \
|
||||||
if [ "$${?}" = "0" ]; then \
|
if [ "$${?}" = "0" ]; then \
|
||||||
${COLOR_ECHO} "${COLOR_GREEN}success${COLOR_RESET}"; \
|
${COLOR_ECHO} "${COLOR_GREEN}success${COLOR_RESET}"; \
|
||||||
|
@ -50,6 +50,7 @@ export DOCKER_ENV_VARS = \
|
|||||||
OFLAGS \
|
OFLAGS \
|
||||||
PREFIX \
|
PREFIX \
|
||||||
QUIET \
|
QUIET \
|
||||||
|
WERROR \
|
||||||
RIOT_VERSION \
|
RIOT_VERSION \
|
||||||
SCANBUILD_ARGS \
|
SCANBUILD_ARGS \
|
||||||
SCANBUILD_OUTPUTDIR \
|
SCANBUILD_OUTPUTDIR \
|
||||||
|
@ -64,10 +64,17 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(QUIET),1)
|
ifeq ($(QUIET),1)
|
||||||
AD=@
|
AD=@
|
||||||
MAKEFLAGS += --no-print-directory
|
MAKEFLAGS += --no-print-directory
|
||||||
else
|
else
|
||||||
AD=
|
AD=
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Fail on warnings. Can be overridden by `make WERROR=0`.
|
||||||
|
WERROR ?= 1
|
||||||
|
export WERROR
|
||||||
|
ifeq ($(WERROR),1)
|
||||||
|
CFLAGS += -Werror
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq (10,$(if ${RIOT_VERSION},1,0)$(if ${__RIOTBUILD_FLAG},1,0))
|
ifneq (10,$(if ${RIOT_VERSION},1,0)$(if ${__RIOTBUILD_FLAG},1,0))
|
||||||
|
@ -25,6 +25,7 @@ SCANBUILD_ENV_VARS := \
|
|||||||
PATH \
|
PATH \
|
||||||
PREFIX \
|
PREFIX \
|
||||||
QUIET \
|
QUIET \
|
||||||
|
WERROR \
|
||||||
RIOT_VERSION \
|
RIOT_VERSION \
|
||||||
SIZE \
|
SIZE \
|
||||||
TOOLCHAIN \
|
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 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 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 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 FLASHER # The command to call on "make flash".
|
||||||
export FFLAGS # The parameters to supply to FLASHER.
|
export FFLAGS # The parameters to supply to FLASHER.
|
||||||
|
Loading…
Reference in New Issue
Block a user