Add C_FLAGS, CPP_FLAGS and ASM_FLAGS variables to the build system BUILD module to allow for language-specific compiler/assembler flags.

This commit is contained in:
Dean Camera 2012-06-02 11:18:28 +00:00
parent 8031d97a4f
commit 924c0eb6ac
2 changed files with 23 additions and 10 deletions

View file

@ -27,8 +27,9 @@ TARGET = Test
SRC = $(TARGET)_C.c $(TARGET)_CPP.cpp Dummy.S $(LUFA_SRC_USB)
LUFA_PATH = ../../LUFA/
CC_FLAGS = -Wextra
#CC_FLAGS += -Werror # FIXME
# Generic C/C++ compiler flags
CC_FLAGS = -Wextra
CC_FLAGS += -Werror
CC_FLAGS += -Wformat=2
CC_FLAGS += -Winit-self
CC_FLAGS += -Wswitch-enum
@ -38,11 +39,9 @@ CC_FLAGS += -Wpointer-arith
CC_FLAGS += -Wcast-align
CC_FLAGS += -Wwrite-strings
CC_FLAGS += -Wlogical-op
CC_FLAGS += -Wmissing-parameter-type
CC_FLAGS += -Wmissing-declarations
CC_FLAGS += -Wmissing-field-initializers
CC_FLAGS += -Wmissing-format-attribute
CC_FLAGS += -Wnested-externs
CC_FLAGS += -Woverlength-strings
# Only enable rendundant declaration warnings for AVR8 target (FIXME)
@ -50,6 +49,10 @@ ifeq ($(ARCH), AVR8)
CC_FLAGS += -Wredundant-decls
endif
# C compiler only flags
C_FLAGS += -Wmissing-parameter-type
C_FLAGS += -Wnested-externs
# Potential additional warnings to enable in the future (FIXME)
#CC_FLAGS += -Wswitch-default
#CC_FLAGS += -Wc++-compat