make flash SERIAL=/dev/ttyUSB0
[Arduino-Nano-VA-meter] / Makefile
1 SERIAL ?= /dev/ttyUSB0
2
3 all: main.hex
4
5 main.hex: main.c
6         avr-gcc -mmcu=atmega328p -Wall -Os -o main.elf main.c -w
7         avr-objcopy -j .text -j .data -O ihex main.elf main.hex
8
9 flash: main.hex
10         avrdude -p m328p -carduino -P$(SERIAL) -b57600 -D -U flash:w:"main.hex":a 
11
12 serial:
13         microcom -p $(SERIAL) -s 9600