2020-12-27 12:40:42 +01:00
|
|
|
CC = avr-gcc
|
|
|
|
OBJCOPY = avr-objcopy
|
|
|
|
AVRDUDE = avrdude
|
|
|
|
CFLAGS = -Os -DF_CPU=16000000UL -mmcu=atmega328p
|
2021-01-03 14:39:38 +01:00
|
|
|
SERIAL = /dev/cu.usbmodem143401
|
2020-12-27 12:40:42 +01:00
|
|
|
ADDR = $(shell heptc -where)/c
|
|
|
|
TARGET = lcd
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: all clean flash
|
|
|
|
|
|
|
|
all: $(TARGET).hex
|
|
|
|
|
|
|
|
flash: $(TARGET).hex
|
|
|
|
$(AVRDUDE) -F -V -c arduino -p ATMEGA328P -P $(SERIAL) -b 115200 \
|
|
|
|
-U flash:w:$<
|
|
|
|
|
|
|
|
|
|
|
|
$(TARGET).hex: $(TARGET)
|
|
|
|
$(OBJCOPY) -O ihex -R .eeprom $< $@
|
|
|
|
|
|
|
|
|
|
|
|
$(TARGET): $(TARGET).o
|
|
|
|
$(CC) $(CFLAGS) -o $@ *.o
|
|
|
|
|
|
|
|
$(TARGET).o : $(TARGET).c
|
|
|
|
$(CC) -g $(CFLAGS) -c -I $(ADDR) -I . $(TARGET).c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(TARGET) $(TARGET).hex $(TARGET).o $(TARGET).log $(TARGET).mls
|
|
|
|
rm -f *.o *.epci *.hex
|
|
|
|
rm -r $(TARGET)_c
|
|
|
|
|
|
|
|
|