aboutsummaryrefslogtreecommitdiff
path: root/arduino-mk
diff options
context:
space:
mode:
authorChristopher Peplin <chris.peplin@rhubarbtech.com>2013-07-02 18:07:23 -0400
committerSudar <sudar@sudarmuthu.com>2013-07-09 21:48:31 +0530
commit1bc31c814b5065cad3acec710c28ef7678f70341 (patch)
tree93b23c9bfbf900401c86449c388699e51dd1a4f4 /arduino-mk
parent87e29ea806e90ab90ccadb2950ff43101ba57144 (diff)
Compile with debugging symbols only when DEBUG=1.
Fix #101
Diffstat (limited to 'arduino-mk')
-rw-r--r--arduino-mk/Arduino.mk10
1 files changed, 8 insertions, 2 deletions
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)