aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2016-06-10 19:03:40 -0400
committerKevin O'Connor <kevin@koconnor.net>2016-06-14 14:00:57 -0400
commitea5f825a916e3c1ba29ea172d94c2f7b8bcaf8dd (patch)
tree266ff2ccca2886617e8349c9596259e1c3f93835
parentb3e4ff7ef098456fe66f69fbcef2bdc27d5b30dc (diff)
downloadkutter-ea5f825a916e3c1ba29ea172d94c2f7b8bcaf8dd.tar.gz
kutter-ea5f825a916e3c1ba29ea172d94c2f7b8bcaf8dd.tar.xz
kutter-ea5f825a916e3c1ba29ea172d94c2f7b8bcaf8dd.zip
build: Default to O2 optimization
Default to O2 and set Os in the AVR makefile. Platforms besides AVR are likely to produce better code with O2 so make that the default. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r--Makefile2
-rw-r--r--src/avr/Makefile2
2 files changed, 2 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 170ce9fb..4149f879 100644
--- a/Makefile
+++ b/Makefile
@@ -32,7 +32,7 @@ dirs-y = src
cc-option=$(shell if test -z "`$(1) $(2) -S -o /dev/null -xc /dev/null 2>&1`" \
; then echo "$(2)"; else echo "$(3)"; fi ;)
-CFLAGS-y := -I$(OUT) -Isrc -I$(OUT)board-generic/ -Os -MD -g \
+CFLAGS-y := -I$(OUT) -Isrc -I$(OUT)board-generic/ -O2 -MD -g \
-Wall -Wold-style-definition $(call cc-option,$(CC),-Wtype-limits,) \
-ffunction-sections -fdata-sections
CFLAGS-y += -flto -fwhole-program
diff --git a/src/avr/Makefile b/src/avr/Makefile
index ce580265..af8d9f49 100644
--- a/src/avr/Makefile
+++ b/src/avr/Makefile
@@ -5,7 +5,7 @@ CROSS_PREFIX=avr-
dirs-y += src/avr lib/pjrc_usb_serial
-CFLAGS-y += -mmcu=$(CONFIG_MCU) -DF_CPU=$(CONFIG_CLOCK_FREQ)
+CFLAGS-y += -Os -mmcu=$(CONFIG_MCU) -DF_CPU=$(CONFIG_CLOCK_FREQ)
LDFLAGS-y += -Wl,--relax
# Add avr source files