configured avr-gcc for dead code removal

This commit is contained in:
Simen Svale Skogsrud 2011-01-26 12:57:54 +01:00
parent 35f499c00c
commit a7b596caac

View File

@ -38,7 +38,7 @@ FUSES = -U hfuse:w:0xd2:m -U lfuse:w:0xff:m
# Tune the lines below only if you know what you are doing: # Tune the lines below only if you know what you are doing:
AVRDUDE = avrdude $(PROGRAMMER) -p $(DEVICE) -B 10 -F AVRDUDE = avrdude $(PROGRAMMER) -p $(DEVICE) -B 10 -F
COMPILE = avr-gcc -Wall -Os -DF_CPU=$(CLOCK) -mmcu=$(DEVICE) -I. COMPILE = avr-gcc -Wall -Os -DF_CPU=$(CLOCK) -mmcu=$(DEVICE) -I. -ffunction-sections
# symbolic targets: # symbolic targets:
all: grbl.hex all: grbl.hex
@ -74,7 +74,7 @@ clean:
# file targets: # file targets:
main.elf: $(OBJECTS) main.elf: $(OBJECTS)
$(COMPILE) -o main.elf $(OBJECTS) -lm $(COMPILE) -o main.elf $(OBJECTS) -lm -Wl,--gc-sections
grbl.hex: main.elf grbl.hex: main.elf
rm -f grbl.hex rm -f grbl.hex