mirror of
https://github.com/andreili/klipper.git
synced 2025-08-24 03:44:06 +02:00
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>
23 lines
645 B
Makefile
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 $< $@
|