From 0e1b590ec603cf52508f51fb970ac7b11d2a56ad Mon Sep 17 00:00:00 2001 From: LongHairedHacker Date: Tue, 8 Dec 2015 00:07:46 +0100 Subject: [PATCH] Fixed gc-sections option for linker --- firmware/demo/Makefile | 6 +++--- firmware/testrig/Makefile | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/firmware/demo/Makefile b/firmware/demo/Makefile index 3d80222..c9e3a5a 100644 --- a/firmware/demo/Makefile +++ b/firmware/demo/Makefile @@ -24,12 +24,12 @@ OBJ += $(LIBS:%=$(OBJDIR)/$(AVRMCU)/libs/%.o) CFLAGS = -Os -Wall -Wstrict-prototypes -#CFLAGS += -ffunction-sections -fdata-sections +CFLAGS += -ffunction-sections -fdata-sections CFLAGS += -fshort-enums -fpack-struct -funsigned-char -funsigned-bitfields CFLAGS += -I . -I $(LIB_DIR)/include CFLAGS += -mmcu=$(AVRMCU) -DF_CPU=$(F_CPU)UL -DVERSION=$(VERSION) -LDFLAGS = #-Wl,--print-gc-sections,--gc-sections +LDFLAGS = -mmcu=$(AVRMCU) -Wl,--gc-sections all: start $(OBJDIR)/$(AVRMCU)/$(TARGET).hex size @echo ":: Done !" @@ -49,7 +49,7 @@ $(OBJDIR)/$(AVRMCU)/%.o : %.c $(HEADERS) $(LIB_HEADERS) $(CC) $(CFLAGS) -c $< -o $@ $(OBJDIR)/$(AVRMCU)/$(TARGET).elf : $(OBJ) - $(CC) $+ -o $@ + $(CC) $(LDFLAGS) $+ -o $@ $(OBJDIR)/$(AVRMCU)/$(TARGET).hex : $(OBJDIR)/$(AVRMCU)/$(TARGET).elf $(OBJCOPY) -O ihex $< $@ diff --git a/firmware/testrig/Makefile b/firmware/testrig/Makefile index b0da921..6f0a72b 100644 --- a/firmware/testrig/Makefile +++ b/firmware/testrig/Makefile @@ -24,12 +24,12 @@ OBJ += $(LIBS:%=$(OBJDIR)/$(AVRMCU)/libs/%.o) CFLAGS = -Os -Wall -Wstrict-prototypes -#CFLAGS += -ffunction-sections -fdata-sections +CFLAGS += -ffunction-sections -fdata-sections CFLAGS += -fshort-enums -fpack-struct -funsigned-char -funsigned-bitfields CFLAGS += -I . -I $(LIB_DIR)/include CFLAGS += -mmcu=$(AVRMCU) -DF_CPU=$(F_CPU)UL -DVERSION=$(VERSION) -LDFLAGS = #-Wl,--print-gc-sections,--gc-sections +LDFLAGS = -mmcu=$(AVRMCU) -Wl,--gc-sections all: start $(OBJDIR)/$(AVRMCU)/$(TARGET).hex size @echo ":: Done !" @@ -49,7 +49,7 @@ $(OBJDIR)/$(AVRMCU)/%.o : %.c $(HEADERS) $(LIB_HEADERS) $(CC) $(CFLAGS) -c $< -o $@ $(OBJDIR)/$(AVRMCU)/$(TARGET).elf : $(OBJ) - $(CC) $+ -o $@ + $(CC) $(LDFLAGS) $+ -o $@ $(OBJDIR)/$(AVRMCU)/$(TARGET).hex : $(OBJDIR)/$(AVRMCU)/$(TARGET).elf $(OBJCOPY) -O ihex $< $@