4 FEATURES := LCD_SHIFTREG LCD_ASYNC
5 CFLAGS := -Wall -Os -ffunction-sections -fdata-sections -mmcu=$(MCU) -DF_CPU=$(CLOCK) $(patsubst %,-D%,$(FEATURES))
6 LDFLAGS := -Os -Wl,--gc-sections -mmcu=$(MCU)
9 ifeq ($(MCU),atmega168)
17 @echo " %.hex: Build firmware from %.c"
18 @echo " upload-%: Upload firmware to AVR"
19 @echo " clean: Clean all built files"
22 @echo " MCU: Microcontroller type"
23 @echo " Arduino Duemilanove = atmega328p (default)"
24 @echo " Arduino Mini = atmega168"
27 $(OBJCOPY) -O ihex $< $@
30 $(CC) $(LDFLAGS) -o $@ $^
33 $(CC) -c $(CFLAGS) -o $@ $<
36 $(AVRDUDE) -p$(MCU) -carduino -P/dev/ttyUSB0 -b$(BAUD) -D -Uflash:w:$<:i
43 s88w-t.elf: serial.o timer.o eeprom.o
44 s88w-r.elf: serial.o lcd.o timer.o