rules: provide default C and C++ standards
Default CSTD to c99, no default for CXXSTD, but if provided it will be used. Add required gnu99 flags to projects using gnu styles.
This commit is contained in:
@@ -43,6 +43,7 @@ STYLECHECK := /checkpatch.pl
|
||||
STYLECHECKFLAGS := --no-tree -f --terse --mailback
|
||||
STYLECHECKFILES := $(shell find . -name '*.[ch]')
|
||||
OPT := -Os
|
||||
CSTD ?= -std=c99
|
||||
|
||||
|
||||
###############################################################################
|
||||
@@ -96,7 +97,7 @@ SCRIPT_DIR = $(OPENCM3_DIR)/scripts
|
||||
###############################################################################
|
||||
# C flags
|
||||
|
||||
TGT_CFLAGS += $(OPT) -g
|
||||
TGT_CFLAGS += $(OPT) $(CSTD) -g
|
||||
TGT_CFLAGS += $(ARCH_FLAGS)
|
||||
TGT_CFLAGS += -Wextra -Wshadow -Wimplicit-function-declaration
|
||||
TGT_CFLAGS += -Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes
|
||||
@@ -105,7 +106,7 @@ TGT_CFLAGS += -fno-common -ffunction-sections -fdata-sections
|
||||
###############################################################################
|
||||
# C++ flags
|
||||
|
||||
TGT_CXXFLAGS += $(OPT) -g
|
||||
TGT_CXXFLAGS += $(OPT) $(CXXSTD) -g
|
||||
TGT_CXXFLAGS += $(ARCH_FLAGS)
|
||||
TGT_CXXFLAGS += -Wextra -Wshadow -Wredundant-decls -Weffc++
|
||||
TGT_CXXFLAGS += -fno-common -ffunction-sections -fdata-sections
|
||||
|
||||
Reference in New Issue
Block a user