37 lines
655 B
Makefile
37 lines
655 B
Makefile
CC = avr-gcc
|
|
OBJCOPY = avr-objcopy
|
|
AVRDUDE = avrdude
|
|
CFLAGS = -Os -DF_CPU=16000000UL -mmcu=atmega328p
|
|
SERIAL = /dev/cu.usbmodem141401
|
|
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
|
|
|
|
|