diff --git a/firmware/Makefile b/firmware/Makefile index c3b183e1fb..80c4655af8 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -7,6 +7,8 @@ CHIBIOS = ChibiOS RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC RULESFILE = $(RULESPATH)/rules.mk +include rusefi_rules.mk + # Define project name here PROJECT = rusefi PROJECT_DIR = . @@ -35,9 +37,12 @@ endif # Compiler options here. ifeq ($(USE_OPT),) - USE_OPT = $(EXTRA_PARAMS) $(DEBUG_LEVEL_OPT) $(RFLAGS) -Wno-error=implicit-fallthrough -Wno-error=bool-operation -fomit-frame-pointer -falign-functions=16 -Werror -Wno-error=pointer-sign -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=sign-compare -Wno-error=unused-parameter -Werror=missing-field-initializers -Werror=type-limits -Wno-error=strict-aliasing -Wno-error=attributes + USE_OPT = $(EXTRA_PARAMS) $(DEBUG_LEVEL_OPT) $(RFLAGS) -Wno-error=implicit-fallthrough -Wno-error=bool-operation -fomit-frame-pointer -falign-functions=16 -Werror=type-limits -Wno-error=strict-aliasing -Wno-error=attributes endif + +USE_OPT += $(RUSEFI_OPT) + # C specific options here (added to USE_OPT). ifeq ($(USE_COPT),) USE_COPT = -fgnu89-inline -std=gnu99 -Werror-implicit-function-declaration diff --git a/firmware/rusefi_rules.mk b/firmware/rusefi_rules.mk new file mode 100644 index 0000000000..4232098583 --- /dev/null +++ b/firmware/rusefi_rules.mk @@ -0,0 +1,5 @@ +RUSEFI_OPT=-Werror -Wno-error=pointer-sign -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=sign-compare -Wno-error=unused-parameter -Werror=missing-field-initializers + +RUSEFI_OPT+=-Wno-error=missing-prototypes + +RUSEFI_OPT+=-Werror=switch \ No newline at end of file diff --git a/simulator/Makefile b/simulator/Makefile index b221a477a8..fa3f5c360a 100644 --- a/simulator/Makefile +++ b/simulator/Makefile @@ -18,6 +18,8 @@ RULESPATH = $(CHIBIOS)/os/common/startup/SIMIA32/compilers/GCC RULESFILE = $(RULESPATH)/rules.mk include ../firmware/rusefi.mk +RULESFILE = ../firmware/rusefi_rules.mk + # Compiler options here. @@ -28,7 +30,7 @@ ifeq ($(USE_OPT),) # this config producec a smaller binary file # 7.3 compiler would want -Wno-error=implicit-fallthrough while 6.4 does not know about it # see https://github.com/rusefi/rusefi/issues/517 - USE_OPT = -Wall -O2 -Wno-error=implicit-fallthrough -Werror-implicit-function-declaration -Werror -Wno-error=pointer-sign -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=sign-compare -Wno-error=unused-parameter -Werror=missing-field-initializers -Wno-error=write-strings -Wno-error=strict-aliasing + USE_OPT = -Wall -O2 -Wno-error=implicit-fallthrough -Wno-error=write-strings -Wno-error=strict-aliasing ifeq ($(OS),Windows_NT) else @@ -36,6 +38,8 @@ ifeq ($(USE_OPT),) endif endif +USE_OPT += $(RUSEFI_OPT) + ifeq ($(CCACHE_DIR),) $(info No CCACHE_DIR) else