aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: b6860f5f9a04774656ad9a2ae26578fc266720fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
.POSIX:
.SUFFIXES: .ihx .out

CC = avr-gcc
CFLAGS = -Wall -std=c99 -mmcu=avr5 -O2
LD = avr-ld
LDFLAGS = -T ld-script
OBJCOPY = avr-objcopy

OBJS = on.o

a.ihx: a.out

send: a.ihx
	avrdude -patmega328p -carduino -U flash:w:a.ihx:i -P/dev/ttyACM0 -v
	touch send

clean:
	rm -f $(OBJS) a.out a.ihx send

.out.ihx:
	$(OBJCOPY) $< $@ --output-target ihex

a.out: $(OBJS)
	$(LD) $(LDFLAGS) $(OBJS) -o $@

on.o: on.c