klipper/src/avr/Makefile
Kevin O'Connor ea5f825a91 build: Default to O2 optimization
Default to O2 and set Os in the AVR makefile.  Platforms besides AVR
are likely to produce better code with O2 so make that the default.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-06-14 14:00:57 -04:00

23 lines
645 B
Makefile

# Additional avr build rules
# Use the avr toolchain
CROSS_PREFIX=avr-
dirs-y += src/avr lib/pjrc_usb_serial
CFLAGS-y += -Os -mmcu=$(CONFIG_MCU) -DF_CPU=$(CONFIG_CLOCK_FREQ)
LDFLAGS-y += -Wl,--relax
# Add avr source files
src-y += avr/main.c avr/timer.c avr/gpio.c avr/misc.c
src-$(CONFIG_AVR_WATCHDOG) += avr/watchdog.c
src-$(CONFIG_AVR_USBSERIAL) += avr/usbserial.c ../lib/pjrc_usb_serial/usb_serial.c
src-$(CONFIG_AVR_SERIAL) += avr/serial.c
# Build the additional hex output file
target-y += $(OUT)klipper.elf.hex
$(OUT)klipper.elf.hex: $(OUT)klipper.elf
@echo " Creating hex file $@"
$(Q)$(OBJCOPY) -j .text -j .data -O ihex $< $@