Embed glade file in executable
[fw/altos] / aoview / Makefile
index 253a160ed89dd40158313a269cd3336f0bdb950b..1941b080a4026ff67a67db699d46a14b1ee2897c 100644 (file)
@@ -1,7 +1,8 @@
+VERSION=$(shell git describe)
 MODULES=gtk+-2.0 libglade-2.0 gconf-2.0
 INCLUDES=$(shell pkg-config --cflags $(MODULES)) -I..
 WARN= -Wall -Wpointer-arith -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -fno-strict-aliasing
-CFLAGS=$(INCLUDES) -O0 -g $(WARN)
+CFLAGS=$(INCLUDES) -O0 -g $(WARN) -DAOVIEW_VERSION='"$(VERSION)"'
 LIBS=$(shell pkg-config --libs $(MODULES)) -lm
 
 SRC = \
@@ -29,5 +30,10 @@ $(PROG): $(OBJ)
 
 $(OBJ): $(INC)
 
+aoview_main.o: aoview_glade.h
+
 clean:
        rm -f $(OBJ) $(PROG)
+
+aoview_glade.h: aoview.glade
+       sed -e 's/"/\\"/g' -e 's/^/"/' -e 's/$$/"/' $< > $@