From 7e2c0f2e1e89446d7820b4ab0fa349a8d1a06286 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sat, 11 Jan 2014 21:48:41 +0100 Subject: [PATCH] Generate introspection data from XML file Signed-off-by: Sebastian Ramacher --- .gitignore | 1 + Makefile | 31 ++++++++++++++++++++++++------- data/org.pwmt.zathura.synctex.xml | 10 ---------- data/org.pwmt.zathura.xml | 29 +++++++++++++++++++++++++++++ 4 files changed, 54 insertions(+), 17 deletions(-) delete mode 100644 data/org.pwmt.zathura.synctex.xml create mode 100644 data/org.pwmt.zathura.xml diff --git a/.gitignore b/.gitignore index 851795d..4fdda19 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ doc/ zathura.1 zathurarc.5 .version-checks/ +dbus-interface-definitions.c diff --git a/Makefile b/Makefile index f73a7ed..8f76699 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ include config.mk include common.mk PROJECT = zathura -OSOURCE = $(wildcard *.c) +OSOURCE = $(filter-out dbus-interface-definitions.c, $(wildcard *.c)) HEADER = $(wildcard *.h) HEADERINST = version.h document.h macros.h page.h types.h plugin-api.h links.h @@ -37,8 +37,8 @@ ifeq (,$(findstring -DLOCALEDIR,${CPPFLAGS})) CPPFLAGS += -DLOCALEDIR=\"${LOCALEDIR}\" endif -OBJECTS = $(patsubst %.c, %.o, $(SOURCE)) -DOBJECTS = $(patsubst %.c, %.do, $(SOURCE)) +OBJECTS = $(patsubst %.c, %.o, $(SOURCE)) dbus-interface-definitions.o +DOBJECTS = $(patsubst %.o, %.do, $(OBJECTS)) all: options ${PROJECT} po build-manpages @@ -64,7 +64,14 @@ version.h: version.h.in config.mk -e 's/ZVMINOR/${ZATHURA_VERSION_MINOR}/' \ -e 's/ZVREV/${ZATHURA_VERSION_REV}/' \ -e 's/ZVAPI/${ZATHURA_API_VERSION}/' \ - -e 's/ZVABI/${ZATHURA_ABI_VERSION}/' version.h.in > version.h + -e 's/ZVABI/${ZATHURA_ABI_VERSION}/' version.h.in > version.h.tmp + $(QUIET)mv version.h.tmp version.h + +dbus-interface-definitions.c: data/org.pwmt.zathura.xml + $(QUIET)echo "const char* DBUS_INTERFACE_XML =" > dbus-interface-definitions.c.tmp + $(QUIET)sed 's/^\(.*\)$$/"\1\\n"/' data/org.pwmt.zathura.xml >> dbus-interface-definitions.c.tmp + $(QUIET)echo ";" >> dbus-interface-definitions.c.tmp + $(QUIET)mv dbus-interface-definitions.c.tmp dbus-interface-definitions.c %.o: %.c $(ECHO) CC $< @@ -84,8 +91,18 @@ ${PROJECT}: ${OBJECTS} $(QUIET)${CC} ${SFLAGS} ${LDFLAGS} -o $@ ${OBJECTS} ${LIBS} clean: - $(QUIET)rm -rf ${PROJECT} ${OBJECTS} ${PROJECT}-${VERSION}.tar.gz \ - ${DOBJECTS} ${PROJECT}-debug .depend ${PROJECT}.pc doc version.h \ + $(QUIET)rm -rf ${PROJECT} \ + ${OBJECTS} \ + ${PROJECT}-${VERSION}.tar.gz \ + ${DOBJECTS} \ + ${PROJECT}-debug \ + .depend \ + ${PROJECT}.pc \ + doc \ + version.h \ + version.h.tmp \ + dbus-interface-definitions.c \ + dbus-interface-definitions.c.tmp \ *gcda *gcno $(PROJECT).info gcov *.tmp \ .version-checks ifneq "$(wildcard ${RSTTOMAN})" "" @@ -188,7 +205,7 @@ install-headers: ${PROJECT}.pc install-dbus: $(ECHO) installing D-Bus interface definitions $(QUIET)mkdir -m 755 -p $(DESTDIR)$(DBUSINTERFACEDIR) - $(QUIET)install -m 644 data/org.pwmt.zathura.synctex.xml $(DESTDIR)$(DBUSINTERFACEDIR) + $(QUIET)install -m 644 data/org.pwmt.zathura.xml $(DESTDIR)$(DBUSINTERFACEDIR) install-vimftplugin: $(ECHO) installing Vim filetype plugin diff --git a/data/org.pwmt.zathura.synctex.xml b/data/org.pwmt.zathura.synctex.xml deleted file mode 100644 index eb3538e..0000000 --- a/data/org.pwmt.zathura.synctex.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/data/org.pwmt.zathura.xml b/data/org.pwmt.zathura.xml new file mode 100644 index 0000000..600326f --- /dev/null +++ b/data/org.pwmt.zathura.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +