From 925d0670c45e1100e412070fa0ce2405604f219a Mon Sep 17 00:00:00 2001 From: Attila Veghelyi Date: Thu, 29 Jun 2023 16:24:54 +0200 Subject: Init repo --- Makefile_opgui | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 Makefile_opgui (limited to 'Makefile_opgui') 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 -- cgit v1.2.3-54-g00ecf