aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile27
1 files changed, 27 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..b08c634
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,27 @@
+.POSIX:
+.SUFFIXES: .ihx .out
+
+CC = avr-gcc
+CFLAGS = -Wall -std=c99 -mmcu=avr5 -O2
+LD = avr-ld
+LDFLAGS =
+OBJCOPY = avr-objcopy
+
+OBJS = on.o
+
+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.ihx: a.out
+
+a.out: $(OBJS)
+ $(LD) $(LDFLAGS) $(OBJS) -o $@
+
+on.o: on.c