diff options
Diffstat (limited to 'Makefile_opgui')
-rw-r--r-- | Makefile_opgui | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/Makefile_opgui b/Makefile_opgui new file mode 100644 index 0000000..9a15ef7 --- /dev/null +++ b/Makefile_opgui @@ -0,0 +1,67 @@ +# equivalent to #define in c code +VERSION = 0.12.1 +CC = gcc +PREFIX = /usr/local + +CFLAGS = '-DVERSION="$(VERSION)"' `pkg-config --libs --cflags gtk+-3.0` +CFLAGS += -DOPGUI +CFLAGS += -Os -s #size +#CFLAGS += -O3 -s #speed +#CFLAGS += -g #debug + +OBJECTS = opgui.o \ + deviceRW.o \ + progP12.o \ + progP16.o \ + progP18.o \ + progP24.o \ + progEEPROM.o \ + progAVR.o \ + fileIO.o \ + I2CSPI.o \ + coff.o \ + icd.o \ + strings.o \ + resources.o +# progP32.o \ + +# Check if we are running on windows +UNAME := $(shell uname) +ifneq (, $(findstring _NT-, $(UNAME))) + CFLAGS += -mwindows +else + CFLAGS += -lrt +endif + + +# Targets +all: opgui + +opgui : $(OBJECTS) + $(CC) -o $@ $(OBJECTS) $(CFLAGS) + rm $(OBJECTS) resources.c + +%.o : %.c + $(CC) $(CFLAGS) -c $< + +resources.c: resources.xml opgui.glade + glib-compile-resources resources.xml --target=resources.c --generate-source + +clean: + rm -f opgui $(OBJECTS) resources.c + +install: all + #test -d $(prefix) || mkdir $(prefix) + #test -d $(prefix)/bin || mkdir $(prefix)/bin + @echo "Installing opgui" + mkdir -p $(PREFIX)/bin + install -m 0755 opgui $(PREFIX)/bin; + +package: + @echo "Creating opgui_$(VERSION).tar.gz" + @mkdir opgui-$(VERSION) + @cp *.c *.h *.png gpl-2.0.txt Makefile readme resources.xml opgui.glade style.css opgui-$(VERSION) + @tar -czf opgui_$(VERSION).tar.gz opgui-$(VERSION) + @rm -rf opgui-$(VERSION) + +.PHONY: all clean install package |