2013-03-31 21:13:51 -06:00
|
|
|
PROG = main
|
|
|
|
|
2013-04-01 21:17:18 -06:00
|
|
|
MCU = atmega328p
|
|
|
|
|
2013-03-31 21:13:51 -06:00
|
|
|
CC = avr-gcc
|
2013-04-01 21:17:18 -06:00
|
|
|
CFLAGS += -mmcu=$(MCU)
|
2013-03-31 21:13:51 -06:00
|
|
|
CFLAGS += -DF_CPU=16000000UL
|
|
|
|
CFLAGS += -Os
|
|
|
|
CFLAGS += -w
|
|
|
|
|
2013-04-01 21:17:18 -06:00
|
|
|
LDFLAGS += -mmcu=$(MCU)
|
|
|
|
|
2013-03-31 21:13:51 -06:00
|
|
|
AVDFLAGS += -p m328p
|
|
|
|
AVDFLAGS += -c arduino
|
|
|
|
AVDFLAGS += -b 115200
|
|
|
|
AVDFLAGS += -P /dev/ttyACM0
|
|
|
|
|
|
|
|
|
|
|
|
upload: .upload
|
|
|
|
|
|
|
|
.upload: $(PROG).hex
|
|
|
|
avrdude $(AVDFLAGS) -U flash:w:$<
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
$(PROG).hex: $(PROG)
|
|
|
|
avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature $< $@
|
|
|
|
|
|
|
|
main: main.o avr.o
|
|
|
|
|
2013-04-01 21:17:18 -06:00
|
|
|
#main.o: avr.h
|
|
|
|
#avr.o: avr.h
|
|
|
|
|
2013-03-31 21:13:51 -06:00
|
|
|
clean:
|
2013-04-01 21:17:18 -06:00
|
|
|
rm -f $(PROG) *.o *.hex .upload
|
2013-03-31 21:13:51 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|