summaryrefslogtreecommitdiffstats
path: root/Makefile_op
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile_op')
-rw-r--r--Makefile_op52
1 files changed, 52 insertions, 0 deletions
diff --git a/Makefile_op b/Makefile_op
new file mode 100644
index 0000000..2593383
--- /dev/null
+++ b/Makefile_op
@@ -0,0 +1,52 @@
+# equivalent to #define in c code
+VERSION = 0.12.0
+CC = gcc
+CFLAGS = '-DVERSION="$(VERSION)"' -w -Os -s #size
+#CFLAGS = -w -O3 -s
+#CFLAGS = -w -g #debug
+OBJECTS = op.o \
+ progP12.o \
+ progP16.o \
+ progP18.o \
+ progP24.o \
+ progEEPROM.o \
+ progAVR.o \
+ fileIO.o \
+ deviceRW.o \
+ I2CSPI.o \
+ strings.o
+
+UNAME := $(shell uname)
+ifneq (, $(findstring _NT-, $(UNAME)))
+ OPFLAG =
+else
+ OPFLAG = -lrt
+endif
+
+all: op
+
+op : $(OBJECTS)
+ $(CC) $(CFLAGS) $(OBJECTS) -o op $(OPFLAG)
+ rm $(OBJECTS)
+
+%.o : %.c
+ $(CC) $(CFLAGS) -c $<
+
+clean:
+ rm -f op $(OBJECTS)
+
+prefix := /usr/local
+
+install: op
+ test -d $(prefix) || mkdir $(prefix)
+ test -d $(prefix)/bin || mkdir $(prefix)/bin
+ install -m 0755 op $(prefix)/bin;
+
+package:
+ @echo "Creating op_$(VERSION).tar.gz"
+ @mkdir op-$(VERSION)
+ @cp *.c *.h gpl-2.0.txt Makefile readme utils/*.c op-$(VERSION)
+ @tar -czf op_$(VERSION).tar.gz op-$(VERSION)
+ @rm -rf op-$(VERSION)
+
+.PHONY: all clean install package