webradio/firmware/Makefile

22 lines
635 B
Makefile
Raw Normal View History

2020-07-11 12:41:08 +02:00
MCU=atmega88
2020-07-30 19:57:46 +02:00
gitrev=$(shell git describe --tags --dirty --always)
CFLAGS=-g -Wall -Wno-multichar -Wno-overflow -mcall-prologues -mmcu=$(MCU) -O2 -DF_CPU=8000000 -DGITREV=\"$(gitrev)\" -IAVR-SSD1306/Files/
2020-07-11 12:41:08 +02:00
LDFLAGS=-Wl,-gc-sections -Wl,-relax
CC=avr-gcc
TARGET=main
2020-07-30 19:57:46 +02:00
OBJECT_FILES=main.o pm.o batmon.o input.o systick.o oled-display/font.o oled-display/i2c.o oled-display/lcd.o
2020-07-11 12:41:08 +02:00
all: $(TARGET).hex
clean:
rm -f *.o *.hex *.obj *.hex
%.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