summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorroot <root@no.no.james.local>2014-12-08 18:39:07 +0000
committerroot <root@no.no.james.local>2014-12-08 18:39:07 +0000
commit804820fe687affa38a52e302179e4a2293cb1ffb (patch)
treeacb784fd60af24d8c389e366d74409c75802dfa0 /Makefile
downloadrgb_ring-804820fe687affa38a52e302179e4a2293cb1ffb.tar.gz
rgb_ring-804820fe687affa38a52e302179e4a2293cb1ffb.tar.bz2
rgb_ring-804820fe687affa38a52e302179e4a2293cb1ffb.zip
fish
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile41
1 files changed, 41 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..767a9a8
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,41 @@
+CSRCS= lib_ws2812.c blinky.c util.c uart.c stdio.c
+SSRCS=
+CC=avr-gcc -mmcu=atmega328p
+PROJECT=blinky
+HEX=${PROJECT}.hex
+
+AVRDUDE=avrdude
+
+CPPFLAGS=
+CPP=${CC} -E
+
+CFLAGS=-O2 -MP -MD -Wall -Werror -Wno-unused
+
+OBJS=${CSRCS:%.c=%.o} ${SSRCS:%.S=%.o}
+
+default: ${HEX}
+
+clean:
+
+${PROJECT}:${OBJS}
+ ${CC} -o $@ ${OBJS}
+
+${HEX}: ${PROJECT}
+ avr-objcopy -O ihex -R .eeprom $< $@
+
+program: ${HEX}
+ ${AVRDUDE} -F -V -c usbasp -p ATMEGA328P -P usb -U flash:w:$<
+ #${AVRDUDE} -F -V -c avrispmkII -p ATMEGA328P -P usb -U flash:w:$<
+
+
+protos:
+ echo -n > prototypes.h
+ cproto -E "${CPP}" ${CPPFLAGS} -DPROTOTYPING ${CSRCS} > prototypes.h.tmp
+ mv prototypes.h.tmp prototypes.h
+
+clean:
+ /bin/rm -f ${PROJECT} ${HEX} ${OBJS} *~ *.d
+
+
+-include ${CSRCS:%.c=%.d}
+