Commit mthomas changes to GCC and port those changes to IAR
[avr_bc100.git] / BaseTinyFirmware / GCC / avr458 / Makefile
index 844d3dbe9fff90082487d46fde6043fca7ed74e9..49c1c045c65cf043dbd699368a6db7221ceb14d9 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 += -fno-inline-small-functions -fno-split-wide-types\r
 CFLAGS += -MMD -MP -MF dep/$(@F).d  \r
@@ -26,7 +27,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