diff options
| author | Sudar <sudar@sudarmuthu.com> | 2013-12-20 08:40:58 -0800 |
|---|---|---|
| committer | Sudar <sudar@sudarmuthu.com> | 2013-12-20 08:40:58 -0800 |
| commit | a51754c2b2e0b0492d6d2f40d5364d77ade23613 (patch) | |
| tree | 13ea1a69b410534ece1a7cc2e9977113dc970e32 /arduino-mk/Arduino.mk | |
| parent | e721a249cde075223ad31ece5c876574062ba7cd (diff) | |
| parent | d3e7eedd5f0dcef8033e410a904f3e260dbd700b (diff) | |
Merge pull request #143 from mahoy/master
Allow target specific optimization levels/debug flags
Diffstat (limited to 'arduino-mk/Arduino.mk')
| -rw-r--r-- | arduino-mk/Arduino.mk | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/arduino-mk/Arduino.mk b/arduino-mk/Arduino.mk index 256e4bf..5ee2fdb 100644 --- a/arduino-mk/Arduino.mk +++ b/arduino-mk/Arduino.mk @@ -780,6 +780,13 @@ else $(call show_config_variable,OPTIMIZATION_LEVEL,[USER]) endif +ifndef DEBUG_FLAGS + DEBUG_FLAGS = -O0 -g +endif + +# SoftwareSerial requires -Os (some delays are tuned for this optimization level) +%SoftwareSerial.o : OPTIMIZATION_FLAGS = -Os + ifndef MCU_FLAG_NAME MCU_FLAG_NAME = mmcu $(call show_config_variable,MCU_FLAG_NAME,[DEFAULT]) @@ -794,11 +801,13 @@ CPPFLAGS += -$(MCU_FLAG_NAME)=$(MCU) -DF_CPU=$(F_CPU) -DARDUINO=$(ARDUINO_V -fdata-sections ifdef DEBUG -CPPFLAGS += -O0 -g +OPTIMIZATION_FLAGS= $(DEBUG_FLAGS) else -CPPFLAGS += -O$(OPTIMIZATION_LEVEL) +OPTIMIZATION_FLAGS = -O$(OPTIMIZATION_LEVEL) endif +CPPFLAGS += $(OPTIMIZATION_FLAGS) + # USB IDs for the Caterina devices like leonardo or micro ifneq ($(CATERINA),) CPPFLAGS += -DUSB_VID=$(USB_VID) -DUSB_PID=$(USB_PID) |
