Improve makefiles with more listing outputs as well as stop linker crashes using...
[avr_bc100.git] / BaseTinyFirmware / GCC / avr463 / Makefile
index fd8c0f68b5bdb0b73e307478b1baee974baff4ee..c2c00b08049f49e47896cbf5e25634144dca7adf 100644 (file)
@@ -13,8 +13,10 @@ COMMON = -mmcu=$(MCU)
 \r
 ## Compile options common for all C compilation units.\r
 CFLAGS = $(COMMON)\r
-CFLAGS += -Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -DNIMH\r
-CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d \r
+CFLAGS += -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -ffunction-sections\r
+CFLAGS += -Wall -Wstrict-prototypes -Wundef -Wa,-adhlns=./$(*F).lst\r
+CFLAGS += -MMD -MP -MF dep/$(@F).d  \r
+CFLAGS += -DNIMH\r
 \r
 ## Assembly specific flags\r
 ASMFLAGS = $(COMMON)\r
@@ -23,7 +25,7 @@ ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf2
 \r
 ## Linker flags\r
 LDFLAGS = $(COMMON)\r
-LDFLAGS +=  -Wl,-Map=$(PROJECT).map -Wl,--relax\r
+LDFLAGS +=  -Wl,-Map=$(PROJECT).map,--cref -Wl,-gc-sections -Wl,-relax\r
 \r
 \r
 ## Intel Hex file production flags\r
@@ -100,7 +102,7 @@ size: ${TARGET}
 ## Clean target\r
 .PHONY: clean\r
 clean:\r
-       -rm -rf $(OBJECTS) $(PROJECT).elf dep $(PROJECT).hex $(PROJECT).eep $(PROJECT).lss $(PROJECT).map\r
+       -rm -rf $(OBJECTS) $(PROJECT).elf dep $(PROJECT).hex $(PROJECT).eep $(PROJECT).lss $(PROJECT).map *.lst\r
 \r
 \r
 ## Other dependencies\r