4 CFLAGS := -Wall -std=c99 -Os -ffunction-sections -fdata-sections -mmcu=$(MCU) -DF_CPU=$(CLOCK) $(patsubst %,-D%,$(FEATURES)) -I../common
5 LDFLAGS := -Os -Wl,--gc-sections -mmcu=$(MCU)
9 ifeq ($(MCU),atmega168)
19 @echo " %.hex: Build firmware from %.c"
20 @echo " upload-%: Upload firmware to AVR"
21 @echo " clean: Clean all built files"
24 @echo " MCU: Microcontroller type"
25 @echo " Arduino Duemilanove = atmega328p (default)"
26 @echo " Arduino Mini = atmega168"
29 $(OBJCOPY) -O ihex $< $@
32 $(CC) $(LDFLAGS) -o $@ $^
35 $(CC) -c $(CFLAGS) -o $@ $<
38 $(AVRDUDE) -p$(MCU) -carduino -P$(DEVICE) -b$(BAUD) -D -Uflash:w:$<:i