Control C standard with a CFLAGS_STD flag, GNU99 by default.

This commit is contained in:
Christopher Peplin 2013-07-03 16:37:20 -04:00
parent ae77089bdd
commit f90087a329
2 changed files with 8 additions and 4 deletions

View file

@ -780,8 +780,11 @@ ifeq ($(VARIANT),leonardo)
CPPFLAGS += -DUSB_VID=$(USB_VID) -DUSB_PID=$(USB_PID) CPPFLAGS += -DUSB_VID=$(USB_VID) -DUSB_PID=$(USB_PID)
endif endif
ifdef USE_GNU99 ifndef CFLAGS_STD
CFLAGS += -std=gnu99 CFLAGS_STD = -std=gnu99
$(call show_config_variable,CFLAGS_STD,[DEFAULT])
else
$(call show_config_variable,CFLAGS_STD,[USER])
endif endif
CFLAGS += $(EXTRA_FLAGS) $(EXTRA_CFLAGS) CFLAGS += $(EXTRA_FLAGS) $(EXTRA_CFLAGS)

View file

@ -96,5 +96,6 @@ LDSCRIPT_FILE = $(ARDUINO_CORE_PATH)/$(LDSCRIPT)
MCU_FLAG_NAME=mprocessor MCU_FLAG_NAME=mprocessor
LDFLAGS += -T$(ARDUINO_CORE_PATH)/$(LDSCRIPT) LDFLAGS += -T$(ARDUINO_CORE_PATH)/$(LDSCRIPT)
CPPFLAGS += -mno-smart-io -fno-short-double CPPFLAGS += -mno-smart-io -fno-short-double
CFLAGS_STD =
include $(ARDMK_DIR)/arduino-mk/Arduino.mk include $(ARDMK_DIR)/arduino-mk/Arduino.mk