summaryrefslogtreecommitdiff
path: root/Makefile
blob: f674c9e3426da30f9e7d984cd5c6bdbb0027e527 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
CC 	= avr-gcc
CFLAGS	= -O2 -Wall -Wextra -Werror -mmcu=atmega328p
OBJCOPY	= avr-objcopy

PORT	?= /dev/ttyACM0

all: notes lcd

notes:
	${CC} ${CFLAGS} main.c
	${OBJCOPY} -j .text -j .data -O ihex a.out main.hex
	rm -f a.out

flash_notes: notes
	avrdude -p atmega328p -c arduino -P ${PORT} -b 115200 -U flash:w:main.hex:i

lcd:
	${CC} ${CFLAGS} main.c
	${OBJCOPY} -j .text -j .data -O ihex a.out main.hex
	rm -f a.out

flash_lcd: notes
	avrdude -p atmega328p -c arduino -P ${PORT} -b 115200 -U flash:w:main.hex:i