From 1bc31c814b5065cad3acec710c28ef7678f70341 Mon Sep 17 00:00:00 2001 From: Christopher Peplin Date: Tue, 2 Jul 2013 18:07:23 -0400 Subject: Compile with debugging symbols only when DEBUG=1. Fix #101 --- arduino-mk/Arduino.mk | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'arduino-mk/Arduino.mk') diff --git a/arduino-mk/Arduino.mk b/arduino-mk/Arduino.mk index a494293..9a3fc06 100644 --- a/arduino-mk/Arduino.mk +++ b/arduino-mk/Arduino.mk @@ -764,8 +764,14 @@ endif # Using += instead of =, so that CPPFLAGS can be set per sketch level CPPFLAGS += -$(MCU_FLAG_NAME)=$(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) -- cgit v1.2.3