Add GCC optimizations
[avr_bc100.git] / BaseTinyFirmware / GCC / avr458 / Makefile
index c2d1462e600dd9cc3cb6bdc05cac0465160bf532..35214cde2aa126f83787a901843a1d7890cd0e8a 100644 (file)
@@ -13,7 +13,8 @@ COMMON = -mmcu=$(MCU)
 \r
 ## Compile options common for all C compilation units.\r
 CFLAGS = $(COMMON)\r
-CFLAGS += -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums\r
+CFLAGS += -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -ffunction-sections\r
+CFLAGS += -fno-inline-small-functions -fno-split-wide-types\r
 CFLAGS += -Wall -Wstrict-prototypes -Wundef -Wa,-adhlns=./$(*F).lst\r
 CFLAGS += -MMD -MP -MF dep/$(@F).d  \r
 CFLAGS += -DLIION\r
@@ -25,7 +26,7 @@ ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf2
 \r
 ## Linker flags\r
 LDFLAGS = $(COMMON)\r
-LDFLAGS +=  -Wl,-Map=$(PROJECT).map,--cref -Wl,-relax\r
+LDFLAGS +=  -Wl,-Map=$(PROJECT).map,--cref -Wl,-relax -Wl,-gc-sections\r
 \r
 ## Intel Hex file production flags\r
 HEX_FLASH_FLAGS = -R .eeprom\r