2018-05-05 22:28:43 +02:00
|
|
|
MCU=atmega8
|
2019-10-26 22:31:21 +02:00
|
|
|
PDEV=/dev/ttyUSB1
|
2018-05-05 22:28:43 +02:00
|
|
|
CFLAGS=-g -Wall -mcall-prologues -mmcu=$(MCU) -Os -DF_CPU=8000000
|
|
|
|
LDFLAGS=-Wl,-gc-sections -Wl,-relax
|
|
|
|
CC=avr-gcc
|
|
|
|
TARGET=main
|
|
|
|
OBJECT_FILES=main.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
|
2019-10-26 22:31:21 +02:00
|
|
|
avrdude -p $(MCU) -P $(PDEV) -c arduino -b 19200 -U flash:w:$(TARGET).hex
|
2018-05-05 22:28:43 +02:00
|
|
|
|
|
|
|
fuse:
|
|
|
|
avrdude -p m8 -c usbasp -U lfuse:w:0xe4:m -U hfuse:w:0xd9:m
|
|
|
|
|
|
|
|
.phony: program fuse
|