From abd457ba73a7d5ce940ff94b52d0f8af1d57d256 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Sun, 29 Sep 2019 21:19:32 -0600 Subject: [PATCH] Fix building AVR hex files --- src/arch/avr/arch.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/arch/avr/arch.mk b/src/arch/avr/arch.mk index 08b2dd7..8670e1b 100644 --- a/src/arch/avr/arch.mk +++ b/src/arch/avr/arch.mk @@ -1,4 +1,5 @@ CC=avr-gcc -mmcu=$(EC) +CFLAGS+=-Os -fstack-usage -Wall -Wl,--gc-sections -Wl,-u,vfprintf -lprintf_flt OBJ=$(patsubst src/%.c,$(BUILD)/%.o,$(SRC)) # Run EC rom in simulator @@ -11,7 +12,7 @@ $(BUILD)/ec.rom: $(BUILD)/ec.ihx makebin -p < $< > $@ # Convert from ELF file to Intel Hex file -$(BUILD)/ec.ihx: $(OBJ) +$(BUILD)/ec.ihx: $(BUILD)/ec.elf @mkdir -p $(@D) avr-objcopy -j .text -j .data -O ihex $< $@