21 lines
554 B
Makefile
21 lines
554 B
Makefile
MCU=atmega88
|
|
CFLAGS=-g -Wall -Wno-multichar -Wno-overflow -mcall-prologues -mmcu=$(MCU) -O2 -DF_CPU=8000000 -IAVR-SSD1306/Files/
|
|
LDFLAGS=-Wl,-gc-sections -Wl,-relax
|
|
CC=avr-gcc
|
|
TARGET=main
|
|
OBJECT_FILES=main.o batmon.o input.o systick.o oled-display/font.o oled-display/i2c.o oled-display/lcd.o
|
|
|
|
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
|