diff options
| author | Christopher Peplin <chris.peplin@rhubarbtech.com> | 2013-07-02 18:07:23 -0400 |
|---|---|---|
| committer | Sudar <sudar@sudarmuthu.com> | 2013-07-09 21:48:31 +0530 |
| commit | 1bc31c814b5065cad3acec710c28ef7678f70341 (patch) | |
| tree | 93b23c9bfbf900401c86449c388699e51dd1a4f4 | |
| parent | 87e29ea806e90ab90ccadb2950ff43101ba57144 (diff) | |
Compile with debugging symbols only when DEBUG=1.
Fix #101
| -rw-r--r-- | HISTORY.md | 1 | ||||
| -rw-r--r-- | arduino-mk/Arduino.mk | 10 |
2 files changed, 9 insertions, 2 deletions
@@ -15,6 +15,7 @@ The following is the rough list of changes that went into different versions. I - Remove dependency on wait-connection-leonardo shell script. Fix issue #95 - Add support for the Digilent chipKIT platform. (https://github.com/peplin) - Implement ard-parse-boards with shell scripting instead of Perl (https://github.com/peplin) +- Compile with debugging symbols only when DEBUG=1 (https://github.com/peplin) ### 0.12.0 (2013-06-20) - Fix "generated_assembly" target, which got broken earlier. Fix issue #76 (https://github.com/matthijskooijman) 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) |
