Compile with debugging symbols only when DEBUG=1.

This commit is contained in:
Christopher Peplin 2013-07-02 18:07:23 -04:00
parent 8a2e251e95
commit 10d427f2e9

View file

@ -755,8 +755,14 @@ endif
# Using += instead of =, so that CPPFLAGS can be set per sketch level
CPPFLAGS += -mmcu=$(MCU) -DF_CPU=$(F_CPU) -DARDUINO=$(ARDUINO_VERSION) \
-I. -I$(ARDUINO_CORE_PATH) -I$(ARDUINO_VAR_PATH)/$(VARIANT) \
$(SYS_INCLUDES) $(USER_INCLUDES) -g -O$(OPTIMIZATION_LEVEL) -Wall \
-ffunction-sections -fdata-sections
$(SYS_INCLUDES) $(USER_INCLUDES) -Wall -ffunction-sections \
-fdata-sections
ifdef DEBUG
CPPFLAGS += -O0 -g
else
CPPFLAGS += -O$(OPTIMIZATION_LEVEL)
endif
# USB IDs for the Leonardo
ifeq ($(VARIANT),leonardo)