summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile34
1 files changed, 34 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..62c9f57
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,34 @@
+SRCS=main.c
+PROG=main.hex
+
+CC=sdcc-sdcc
+CFLAGS=-p16f917 -mpic14 -Wl,-m
+#-Wl,-s12f675.lkr
+TYPE=PIC16F917
+
+OD=odyssey
+
+
+OBJS=${SRCS:%.c=%.o}
+
+DIS=${PROG:%.hex=%.dis}
+
+default:${PROG} ${DIS}
+
+${DIS}:${PROG}
+ gpdasm -p${TYPE} $< > $@ || /bin/rm -f $@
+${PROG}:${OBJS}
+ ${CC} ${CFLAGS} -o $@ ${OBJS}
+
+%.o:%.c
+ ${CC} ${CFLAGS} -c $<
+
+clean:
+ /bin/rm -f ${PROG} ${OBJS} *% *~ *.sym *.lst *.cod *.asm *.dis *.map
+
+prog: ${PROG}
+ ${OD} ${TYPE} erase
+ ${OD} ${TYPE} check
+ ${OD} ${TYPE} write ${PROG}
+ ${OD} ${TYPE} verify ${PROG}
+