22 lines
511 B
Makefile
22 lines
511 B
Makefile
MCU=atmega8
|
|
CFLAGS=-g -Wall --param=min-pagesize=0 -mcall-prologues -mmcu=$(MCU) -Os -DF_CPU=16000000
|
|
LDFLAGS=-Wl,-gc-sections -Wl,-relax
|
|
CC=avr-gcc
|
|
TARGET=leddie-firmware
|
|
OBJECT_FILES=lib/light_ws2812.o lib/pm.o lib/mma8653.o main.o
|
|
|
|
all: $(TARGET).hex
|
|
|
|
clean:
|
|
rm -f *.o *.hex *.obj *.hex
|
|
rm -f lib/*.o
|
|
|
|
%.hex: %.obj
|
|
avr-objcopy -R .eeprom -O ihex $< $@
|
|
|
|
%.obj: $(OBJECT_FILES)
|
|
$(CC) $(CFLAGS) $(OBJECT_FILES) $(LDFLAGS) -o $@
|
|
|
|
program: $(TARGET).hex
|
|
avrdude -p $(MCU) -c usbasp -U flash:w:$(TARGET).hex
|