[folks] build: Factor common backends/*/lib makefilery into backend-library.mk



commit 9864169bfd0631ca5b46eccb77c37ea6411059a1
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Thu Nov 28 11:40:22 2013 +0000

    build: Factor common backends/*/lib makefilery into backend-library.mk
    
    This simplifies and standardises the build process for the installed
    backend libraries (libfolks-eds.so and friends).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=711544

 backends/Makefile.am                        |    5 +-
 backends/backend-library.mk                 |  178 ++++++++++++++++++++++++++
 backends/eds/lib/Makefile.am                |  132 ++-----------------
 backends/libsocialweb/lib/Makefile.am       |  126 ++-----------------
 backends/telepathy/lib/Makefile.am          |  183 ++++-----------------------
 backends/tracker/lib/Makefile.am            |  121 +++----------------
 configure.ac                                |    1 -
 tests/lib/telepathy/contactlist/Makefile.am |    2 +-
 8 files changed, 252 insertions(+), 496 deletions(-)
---
diff --git a/backends/Makefile.am b/backends/Makefile.am
index f3d5e18..148a944 100644
--- a/backends/Makefile.am
+++ b/backends/Makefile.am
@@ -36,6 +36,9 @@ DIST_SUBDIRS = \
        tracker \
        $(NULL)
 
-EXTRA_DIST = backend.mk
+EXTRA_DIST = \
+       backend.mk \
+       backend-library.mk \
+       $(NULL)
 
 -include $(top_srcdir)/git.mk
diff --git a/backends/backend-library.mk b/backends/backend-library.mk
new file mode 100644
index 0000000..ea504ff
--- /dev/null
+++ b/backends/backend-library.mk
@@ -0,0 +1,178 @@
+#
+# Common build variable values for folks backend libraries.
+#
+# Required variables:
+#  - BACKEND_NAME = name-of-backend
+#    (this must be the same as the source directory and the backend's type ID)
+#  - BACKEND_NAME_C = NameOfBackend
+#    (BACKEND_NAME in CamelCase for the GIR filename)
+#  - BACKEND_LT_VERSION = $(FOLKS_something_LT_VERSION)
+#    (from configure.ac)
+#  - BACKEND_SYMBOLS_REGEX = something
+#    (regex to pass to -export-symbols-regex to determine the backend’s public
+#     symbols)
+# Required targets:
+#  - libfolks-$(BACKEND_NAME).la
+# Defined helper variables (these may be overridden for weird backends):
+#  - BACKEND_LIBRARY_NAME
+#  - BACKEND_LA_FILE
+#  - BACKEND_PC_FILE
+#  - BACKEND_GIR_FILE
+#  - BACKEND_VAPI_FILE
+#  - BACKEND_DEPS_FILE
+#  - BACKEND_HEADER_FILE
+# Defined backend library variables (these must be included in the
+# backend-specific variables):
+#  - backend_library_sources
+#  - backend_library_valaflags
+#  - backend_library_cppflags
+#  - backend_library_cflags
+#  - backend_library_libadd
+#  - backend_library_ldflags
+# in addition, most of these have *_generic variants which don’t include
+# backend-specific flags (for use in helper and utility libraries).
+# The defined variables include flags for the standard dependencies:
+#  - folks
+#  - GIO
+#  - GLib
+#  - libgee
+# and also include the relevant $(AM_*) variables.
+#
+# Additional rules are included for generating and installing the following:
+#  - pkg-config
+#  - VAPI and deps files
+#  - C header file
+#  - GIR and typelib files
+
+# Derived (but still overrideable) variables
+BACKEND_LIBRARY_NAME = folks-$(BACKEND_NAME)
+BACKEND_LA_FILE = lib$(BACKEND_LIBRARY_NAME).la
+BACKEND_PC_FILE = $(BACKEND_LIBRARY_NAME).pc.in
+BACKEND_GIR_FILE = Folks$(BACKEND_NAME_C)-$(API_VERSION_DOT).gir
+BACKEND_VAPI_FILE = $(BACKEND_LIBRARY_NAME).vapi
+BACKEND_DEPS_FILE = $(BACKEND_LIBRARY_NAME).deps
+BACKEND_HEADER_FILE = folks/$(BACKEND_LIBRARY_NAME).h
+
+
+# Added in case it's needed in the future.
+backend_library_sources = \
+       $(NULL)
+
+backend_library_cppflags_generic = \
+       $(AM_CPPFLAGS) \
+       -I$(top_srcdir) \
+       -I$(top_srcdir)/folks \
+       -include $(CONFIG_HEADER) \
+       -include $(top_srcdir)/folks/warnings.h \
+       -DPACKAGE_DATADIR=\"$(pkgdatadir)\" \
+       $(NULL)
+backend_library_cppflags = \
+       $(backend_library_cppflags_generic) \
+       -DBACKEND_NAME=\"$(BACKEND_NAME)\" \
+       -DG_LOG_DOMAIN=\"$(BACKEND_NAME)\" \
+       $(NULL)
+
+backend_library_valaflags_generic = \
+       $(AM_VALAFLAGS) \
+       $(TARGET_VALAFLAGS) \
+       $(ERROR_VALAFLAGS) \
+       --vapidir=. \
+       --vapidir=$(top_srcdir)/folks \
+       --vapidir=$(top_builddir)/folks \
+       --pkg build-conf \
+       --pkg folks \
+       --pkg folks-internal \
+       --pkg folks-generics \
+       --pkg gee-0.8 \
+       --pkg gio-2.0 \
+       --pkg gobject-2.0 \
+       $(NULL)
+backend_library_valaflags = \
+       $(backend_library_valaflags_generic) \
+       --includedir folks \
+       --gir $(BACKEND_GIR_FILE) \
+       --library $(BACKEND_LIBRARY_NAME) \
+       --vapi $(BACKEND_VAPI_FILE) \
+       -H $(BACKEND_HEADER_FILE) \
+       $(NULL)
+
+backend_library_cflags_generic = \
+       $(AM_CFLAGS) \
+       $(ERROR_CFLAGS) \
+       $(CODE_COVERAGE_CFLAGS) \
+       $(GIO_CFLAGS) \
+       $(GLIB_CFLAGS) \
+       $(GEE_CFLAGS) \
+       $(NULL)
+backend_library_cflags = $(backend_library_cflags_generic)
+
+backend_library_libadd_generic = \
+       $(AM_LIBADD) \
+       $(top_builddir)/folks/libfolks.la \
+       $(GIO_LIBS) \
+       $(GLIB_LIBS) \
+       $(GEE_LIBS) \
+       $(NULL)
+backend_library_libadd = $(backend_library_libadd_generic)
+
+backend_library_ldflags_generic = \
+       $(AM_LDFLAGS) \
+       $(CODE_COVERAGE_LDFLAGS) \
+       $(NULL)
+backend_library_ldflags = \
+       $(backend_library_ldflags_generic) \
+       -version-info $(BACKEND_LT_VERSION) \
+       -export-symbols-regex $(BACKEND_SYMBOLS_REGEX) \
+       $(NULL)
+
+
+# Installed headers
+folks_includedir = $(includedir)/folks
+folks_include_HEADERS = $(BACKEND_HEADER_FILE)
+
+vapidir = $(datadir)/vala/vapi
+dist_vapi_DATA = \
+       $(BACKEND_VAPI_FILE) \
+       $(BACKEND_DEPS_FILE) \
+       $(NULL)
+
+
+# pkg-config
+pkgconfig_in = $(BACKEND_PC_FILE)
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = $(pkgconfig_in:.in=)
+EXTRA_DIST += $(pkgconfig_in)
+
+
+# Introspection
+-include $(INTROSPECTION_MAKEFILE)
+INTROSPECTION_SCANNER_ARGS = \
+       $(ERROR_INTROSPECTION_SCANNER_ARGS) \
+       --add-include-path=$(srcdir) \
+       --add-include-path=$(abs_top_builddir)/folks \
+       --warn-all \
+       $(NULL)
+
+# Set PKG_CONFIG_PATH so we can find the backend's uninstalled pkg-config file.
+INTROSPECTION_SCANNER_ENV = \
+       PKG_CONFIG_PATH=$(top_builddir)/folks:$${PKG_CONFIG_PATH}
+
+INTROSPECTION_COMPILER_ARGS = \
+       --includedir=$(srcdir) \
+       --includedir=$(abs_top_builddir)/folks \
+       $(NULL)
+
+if HAVE_INTROSPECTION
+$(BACKEND_GIR_FILE): $(BACKEND_LA_FILE)
+GIRS = $(BACKEND_GIR_FILE)
+
+girdir = $(datadir)/gir-1.0
+dist_gir_DATA = $(GIRS)
+
+MAINTAINERCLEANFILES += $(dist_gir_DATA)
+
+typelibdir = $(libdir)/girepository-1.0
+nodist_typelib_DATA = $(GIRS:.gir=.typelib)
+
+CLEANFILES += $(nodist_typelib_DATA)
+endif
diff --git a/backends/eds/lib/Makefile.am b/backends/eds/lib/Makefile.am
index 49d99ad..868cf7a 100644
--- a/backends/eds/lib/Makefile.am
+++ b/backends/eds/lib/Makefile.am
@@ -1,30 +1,16 @@
-BACKEND_NAME = "eds"
+CLEANFILES =
+MAINTAINERCLEANFILES =
+EXTRA_DIST =
 
-AM_CPPFLAGS = \
-       -I$(top_srcdir) \
-       -I$(top_srcdir)/folks \
-       -include $(CONFIG_HEADER) \
-       -include folks/redeclare-internal-api.h \
-       -DPACKAGE_DATADIR=\"$(pkgdatadir)\" \
-       -DBACKEND_NAME=\"$(BACKEND_NAME)\" \
-       -DG_LOG_DOMAIN=\"$(BACKEND_NAME)\" \
-       $(NULL)
+include $(top_srcdir)/backends/backend-library.mk
 
-VAPIGENFLAGS += \
-       --vapidir=. \
-       --vapidir=$(top_srcdir)/folks \
-       $(NULL)
+BACKEND_NAME = eds
+BACKEND_NAME_C = Eds
+BACKEND_LT_VERSION = $(FOLKS_EDS_LT_VERSION)
+BACKEND_SYMBOLS_REGEX = "^(EDSF|edsf)_.*|"
 
 lib_LTLIBRARIES = libfolks-eds.la
 
-##################################################################
-# Support library
-##################################################################
-
-pkgconfig_in = folks-eds.pc.in
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = $(pkgconfig_in:.in=)
-
 libfolks_eds_la_SOURCES = \
        edsf-namespace.vala \
        edsf-persona.vala \
@@ -32,126 +18,34 @@ libfolks_eds_la_SOURCES = \
        $(NULL)
 
 libfolks_eds_la_VALAFLAGS = \
-       $(AM_VALAFLAGS) \
-       $(TARGET_VALAFLAGS) \
-       $(ERROR_VALAFLAGS) \
-       --vapidir=. \
-       --vapidir=$(top_srcdir)/folks \
-       --pkg folks \
-       --pkg folks-generics \
-       --pkg folks-internal \
-       --pkg gee-0.8 \
-       --pkg gio-2.0 \
-       --pkg gobject-2.0 \
+       $(backend_library_valaflags) \
        --pkg libebook-1.2 \
        --pkg libebook-contacts-1.2 \
        --pkg libedataserver-1.2 \
        --pkg libxml-2.0 \
-       --includedir folks \
-       --gir FolksEds-$(API_VERSION_DOT).gir \
-       --library folks-eds \
-       --vapi folks-eds.vapi \
-       -H folks/folks-eds.h \
        $(NULL)
 
 libfolks_eds_la_CPPFLAGS = \
-       $(AM_CPPFLAGS) \
-       -include $(top_srcdir)/folks/warnings.h \
+       $(backend_library_cppflags) \
        $(NULL)
 
 libfolks_eds_la_CFLAGS = \
-       $(AM_CFLAGS) \
-       $(ERROR_CFLAGS) \
-       $(CODE_COVERAGE_CFLAGS) \
-       $(GIO_CFLAGS) \
-       $(GLIB_CFLAGS) \
-       $(GEE_CFLAGS) \
+       $(backend_library_cflags) \
        $(EBOOK_CFLAGS) \
        $(EDATASERVER_CFLAGS) \
        $(LIBXML_CFLAGS) \
        $(NULL)
 
 libfolks_eds_la_LIBADD = \
-       $(AM_LIBADD) \
-       $(top_builddir)/folks/libfolks.la \
+       $(backend_library_libadd) \
        $(EBOOK_LIBS) \
        $(EDATASERVER_LIBS) \
-       $(GIO_LIBS) \
-       $(GLIB_LIBS) \
-       $(GEE_LIBS) \
        $(LIBXML_LIBS) \
        $(NULL)
 
-# The quoting here is unnecessary but harmless, and has the useful side-effect
-# that vim quickfix mode (:make) doesn't interpret the libtool --mode=link
-# command as an error message in a bizarrely named file
 libfolks_eds_la_LDFLAGS = \
-       $(AM_LDFLAGS) \
-       $(CODE_COVERAGE_LDFLAGS) \
-       -version-info "$(FOLKS_EDS_LT_VERSION)" \
-       -export-symbols-regex "^(EDSF|edsf)_.*|" \
-       $(NULL)
-
-folks_eds_includedir = $(includedir)/folks
-folks_eds_include_HEADERS = \
-       folks/folks-eds.h \
-       $(NULL)
-
-vapidir = $(datadir)/vala/vapi
-dist_vapi_DATA = \
-       folks-eds.vapi \
-       folks-eds.deps \
-       $(NULL)
-
-##################################################################
-# General
-##################################################################
-
-CLEANFILES =
-MAINTAINERCLEANFILES =
-EXTRA_DIST = \
-       $(pkgconfig_in) \
-       $(MAINTAINERCLEANFILES) \
+       $(backend_library_ldflags) \
        $(NULL)
 
-##################################################################
-# Introspection
-##################################################################
-
--include $(INTROSPECTION_MAKEFILE)
-INTROSPECTION_SCANNER_ARGS = \
-       $(ERROR_INTROSPECTION_SCANNER_ARGS) \
-       --add-include-path=$(srcdir) \
-       --add-include-path=$(abs_top_builddir)/folks \
-       --warn-all \
-       $(NULL)
-
-# Set PKG_CONFIG_PATH so we can find the backend's uninstalled pkg-config file.
-INTROSPECTION_SCANNER_ENV = \
-       PKG_CONFIG_PATH=$(top_builddir)/folks:$${PKG_CONFIG_PATH}
-
-INTROSPECTION_COMPILER_ARGS = \
-       --includedir=$(srcdir) \
-       --includedir=$(abs_top_builddir)/folks \
-       $(NULL)
-
-if HAVE_INTROSPECTION
-FolksEds-$(API_VERSION_DOT).gir: libfolks-eds.la
-GIRS = FolksEds-$(API_VERSION_DOT).gir
-
-girdir = $(datadir)/gir-1.0
-dist_gir_DATA = $(GIRS)
-
-MAINTAINERCLEANFILES += $(dist_gir_DATA)
-
-typelibdir = $(libdir)/girepository-1.0
-nodist_typelib_DATA = $(GIRS:.gir=.typelib)
-
-CLEANFILES += $(nodist_typelib_DATA)
-endif
-
-##################################################################
-# Common
-##################################################################
 
 -include $(top_srcdir)/git.mk
diff --git a/backends/libsocialweb/lib/Makefile.am b/backends/libsocialweb/lib/Makefile.am
index b834abb..1e16286 100644
--- a/backends/libsocialweb/lib/Makefile.am
+++ b/backends/libsocialweb/lib/Makefile.am
@@ -1,29 +1,16 @@
-BACKEND_NAME = "libsocialweb"
+CLEANFILES =
+MAINTAINERCLEANFILES =
+EXTRA_DIST =
 
-AM_CPPFLAGS = \
-       -I$(top_srcdir) \
-       -I$(top_srcdir)/folks \
-       -include $(CONFIG_HEADER) \
-       -DPACKAGE_DATADIR=\"$(pkgdatadir)\" \
-       -DBACKEND_NAME=\"$(BACKEND_NAME)\" \
-       -DG_LOG_DOMAIN=\"$(BACKEND_NAME)\" \
-       $(NULL)
+include $(top_srcdir)/backends/backend-library.mk
 
-VAPIGENFLAGS += \
-       --vapidir=. \
-       --vapidir=$(top_srcdir)/folks \
-       $(NULL)
+BACKEND_NAME = libsocialweb
+BACKEND_NAME_C = Libsocialweb
+BACKEND_LT_VERSION = $(FOLKS_LIBSOCIALWEB_LT_VERSION)
+BACKEND_SYMBOLS_REGEX = "^swf_.*"
 
 lib_LTLIBRARIES = libfolks-libsocialweb.la
 
-##################################################################
-# Support library
-##################################################################
-
-pkgconfig_in = folks-libsocialweb.pc.in
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = $(pkgconfig_in:.in=)
-
 libfolks_libsocialweb_la_SOURCES = \
        swf-namespace.vala \
        swf-persona.vala \
@@ -31,114 +18,27 @@ libfolks_libsocialweb_la_SOURCES = \
        $(NULL)
 
 libfolks_libsocialweb_la_VALAFLAGS = \
-       $(AM_VALAFLAGS) \
-       $(TARGET_VALAFLAGS) \
-       $(ERROR_VALAFLAGS) \
-       --vapidir=. \
-       --vapidir=$(top_srcdir)/folks \
-       --pkg folks \
-       --pkg folks-internal \
-       --pkg folks-generics \
-       --pkg gobject-2.0 \
-       --pkg gio-2.0 \
-       --pkg gee-0.8 \
+       $(backend_library_valaflags) \
        --pkg libsocialweb-client \
-       --includedir folks \
-       --gir FolksLibsocialweb-$(API_VERSION_DOT).gir \
-       --library folks-libsocialweb \
-       --vapi folks-libsocialweb.vapi \
-       -H folks/folks-libsocialweb.h \
        $(NULL)
 
 libfolks_libsocialweb_la_CPPFLAGS = \
-       $(AM_CPPFLAGS) \
-       -include $(top_srcdir)/folks/warnings.h \
+       $(backend_library_cppflags) \
        $(NULL)
 
 libfolks_libsocialweb_la_CFLAGS = \
-       $(AM_CFLAGS) \
-       $(ERROR_CFLAGS) \
-       $(GIO_CFLAGS) \
-       $(CODE_COVERAGE_CFLAGS) \
-       $(GLIB_CFLAGS) \
-       $(GEE_CFLAGS) \
+       $(backend_library_cflags) \
        $(SW_CLIENT_CFLAGS) \
        $(NULL)
 
 libfolks_libsocialweb_la_LIBADD = \
-       $(GIO_LIBS) \
-       $(GLIB_LIBS) \
-       $(GEE_LIBS) \
-       $(top_builddir)/folks/libfolks.la \
+       $(backend_library_LIBADD) \
        $(SW_CLIENT_LIBS) \
        $(NULL)
 
-
 libfolks_libsocialweb_la_LDFLAGS = \
-       $(CODE_COVERAGE_LDFLAGS) \
-       -version-info "$(FOLKS_LIBSOCIALWEB_LT_VERSION)" \
-       -export-symbols-regex "^swf_.*" \
-       $(NULL)
-
-folks_libsocialweb_includedir = $(includedir)/folks
-folks_libsocialweb_include_HEADERS = \
-       folks/folks-libsocialweb.h \
-       $(NULL)
-
-vapidir = $(datadir)/vala/vapi
-dist_vapi_DATA = \
-       folks-libsocialweb.vapi \
-       folks-libsocialweb.deps \
-       $(NULL)
-
-##################################################################
-# General
-##################################################################
-
-CLEANFILES =
-MAINTAINERCLEANFILES =
-EXTRA_DIST = \
-       $(pkgconfig_in) \
-       $(MAINTAINERCLEANFILES) \
+       $(backend_library_ldflags) \
        $(NULL)
 
-##################################################################
-# Introspection
-##################################################################
--include $(INTROSPECTION_MAKEFILE)
-INTROSPECTION_SCANNER_ARGS = \
-       $(ERROR_INTROSPECTION_SCANNER_ARGS) \
-       --add-include-path=$(srcdir) \
-       --add-include-path=$(abs_top_builddir)/folks \
-       --warn-all \
-       $(NULL)
-
-# Set PKG_CONFIG_PATH so we can find the backend's uninstalled pkg-config file.
-INTROSPECTION_SCANNER_ENV = \
-       PKG_CONFIG_PATH=$(top_builddir)/folks:$${PKG_CONFIG_PATH}
-
-INTROSPECTION_COMPILER_ARGS = \
-       --includedir=$(srcdir) \
-       --includedir=$(abs_top_builddir)/folks \
-       $(NULL)
-
-if HAVE_INTROSPECTION
-FolksLibsocialweb-$(API_VERSION_DOT).gir: libfolks-libsocialweb.la
-GIRS = FolksLibsocialweb-$(API_VERSION_DOT).gir
-
-girdir = $(datadir)/gir-1.0
-dist_gir_DATA = $(GIRS)
-
-MAINTAINERCLEANFILES += $(dist_gir_DATA)
-
-typelibdir = $(libdir)/girepository-1.0
-nodist_typelib_DATA = $(GIRS:.gir=.typelib)
-
-CLEANFILES += $(nodist_typelib_DATA)
-endif
-
-##################################################################
-# Common
-##################################################################
 
 -include $(top_srcdir)/git.mk
diff --git a/backends/telepathy/lib/Makefile.am b/backends/telepathy/lib/Makefile.am
index a5cd043..d9f7fce 100644
--- a/backends/telepathy/lib/Makefile.am
+++ b/backends/telepathy/lib/Makefile.am
@@ -1,24 +1,22 @@
-BACKEND_NAME = "telepathy"
+CLEANFILES =
+MAINTAINERCLEANFILES =
+EXTRA_DIST =
 
-AM_CPPFLAGS = \
-       -I$(top_srcdir) \
-       -I$(top_srcdir)/folks \
-       -include $(CONFIG_HEADER) \
-       -DPACKAGE_DATADIR=\"$(pkgdatadir)\" \
-       -DBACKEND_NAME=\"$(BACKEND_NAME)\" \
-       -DG_LOG_DOMAIN=\"$(BACKEND_NAME)\" \
-       $(NULL)
+include $(top_srcdir)/backends/backend-library.mk
+
+BACKEND_NAME = telepathy
+BACKEND_NAME_C = Telepathy
+BACKEND_LT_VERSION = $(FOLKS_TELEPATHY_LT_VERSION)
+BACKEND_SYMBOLS_REGEX = "^tpf_.*"
 
-VAPIGENFLAGS += \
+VAPIGENFLAGS = \
        --vapidir=$(abs_builddir) \
        --vapidir=$(abs_srcdir) \
        --vapidir=$(abs_top_builddir)/folks \
        --vapidir=$(abs_top_srcdir)/folks \
        $(NULL)
 
-noinst_LTLIBRARIES = \
-       libtp-lowlevel.la \
-       $(NULL)
+noinst_LTLIBRARIES = libtp-lowlevel.la
 lib_LTLIBRARIES = libfolks-telepathy.la
 
 if ENABLE_ZEITGEIST
@@ -28,13 +26,12 @@ noinst_LTLIBRARIES += libtp-zeitgeist-dummy.la
 endif
 
 # Necessary because they're only conditionally listed in noinst_LTLIBRARIES.
-CLEANFILES = \
+CLEANFILES += \
        libtp-zeitgeist.la \
        libtp-zeitgeist-dummy.la \
        $(NULL)
 
 dist_noinst_DATA =
-EXTRA_DIST =
 
 ##################################################################
 # Telepathy Lowlevel library
@@ -47,13 +44,8 @@ libtp_lowlevel_la_SOURCES = \
 tp_lowlevel_headers = tp-lowlevel.h
 
 libtp_lowlevel_la_CFLAGS = \
-       $(AM_CFLAGS) \
-       $(ERROR_CFLAGS) \
-       $(CODE_COVERAGE_CFLAGS) \
+       $(backend_library_cflags_generic) \
        $(C_ERROR_CFLAGS) \
-       $(GIO_CFLAGS) \
-       $(GLIB_CFLAGS) \
-       $(GEE_CFLAGS) \
        $(TP_GLIB_CFLAGS) \
        $(NULL)
 
@@ -61,8 +53,7 @@ libtp_lowlevel_la_CFLAGS = \
 # despite not being installed (it needs to be a shared library for
 # vala-gen-introspect)
 libtp_lowlevel_la_LDFLAGS = \
-       $(AM_LDFLAGS) \
-       $(CODE_COVERAGE_LDFLAGS) \
+       $(backend_library_ldflags_generic) \
        -shared \
        -rpath $(libdir) \
        -avoid-version \
@@ -103,26 +94,19 @@ libtp_zeitgeist_la_SOURCES = tp-zeitgeist.vala
 libtp_zeitgeist_dummy_la_SOURCES = tp-zeitgeist-dummy.vala
 
 libtp_zeitgeist_la_CFLAGS = \
-       $(AM_CFLAGS) \
-       $(CODE_COVERAGE_CFLAGS) \
-       $(ERROR_CFLAGS) \
-       $(GLIB_CFLAGS) \
-       $(GEE_CFLAGS) \
+       $(backend_library_cflags_generic) \
        $(TP_GLIB_CFLAGS) \
        $(ZEITGEIST_CFLAGS) \
        $(NULL)
 libtp_zeitgeist_dummy_la_CFLAGS = \
-       $(AM_CFLAGS) \
-       $(CODE_COVERAGE_CFLAGS) \
-       $(ERROR_CFLAGS) \
-       $(GLIB_CFLAGS) \
+       $(backend_library_cflags_generic) \
        $(TP_GLIB_CFLAGS) \
-       $(GEE_CFLAGS) \
        $(NULL)
 
 libtp_zeitgeist_la_CPPFLAGS = \
-       $(AM_CPPFLAGS) \
-       -include $(top_srcdir)/folks/warnings.h \
+       $(backend_library_cppflags_generic) \
+       -DBACKEND_NAME=\"$(BACKEND_NAME)\" \
+       -DG_LOG_DOMAIN=\"$(BACKEND_NAME)\" \
        -DABS_TOP_SRCDIR=\"${abs_top_srcdir}\" \
        -DABS_TOP_BUILDDIR=\"${abs_top_builddir}\" \
        -DPKGLIBEXECDIR=\"${pkglibexecdir}\" \
@@ -130,53 +114,29 @@ libtp_zeitgeist_la_CPPFLAGS = \
 libtp_zeitgeist_dummy_la_CPPFLAGS = $(libtp_zeitgeist_la_CPPFLAGS)
 
 libtp_zeitgeist_la_LIBADD = \
-       $(AM_LIBADD) \
-       $(top_builddir)/folks/libfolks.la \
-       $(GLIB_LIBS) \
-       $(GEE_LIBS) \
+       $(backend_library_libadd_generic) \
        $(TP_GLIB_LIBS) \
        $(ZEITGEIST_LIBS) \
        $(NULL)
 libtp_zeitgeist_dummy_la_LIBADD = \
-       $(AM_LIBADD) \
-       $(top_builddir)/folks/libfolks.la \
-       $(GLIB_LIBS) \
-       $(GEE_LIBS) \
+       $(backend_library_libadd_generic) \
        $(TP_GLIB_LIBS) \
        $(NULL)
 
 libtp_zeitgeist_la_VALAFLAGS = \
-       $(AM_VALAFLAGS) \
-       $(TARGET_VALAFLAGS) \
-       $(ERROR_VALAFLAGS) \
-       --vapidir=$(abs_top_srcdir)/folks \
-       --vapidir=$(abs_top_builddir)/folks \
-       --pkg gobject-2.0 \
-       --pkg gio-2.0 \
-       --pkg gee-0.8 \
+       $(backend_library_valaflags_generic) \
        --pkg zeitgeist-2.0 \
        --pkg telepathy-glib \
-       --pkg folks \
-       --pkg build-conf \
        --library tp-zeitgeist \
        --vapi tp-zeitgeist.vapi \
        -H tp-zeitgeist.h \
-       -g \
        $(NULL)
 libtp_zeitgeist_dummy_la_VALAFLAGS = \
-       $(AM_VALAFLAGS) \
-       $(TARGET_VALAFLAGS) \
-       $(ERROR_VALAFLAGS) \
-       --vapidir=$(abs_top_srcdir)/folks \
-       --vapidir=$(abs_top_builddir)/folks \
-       --pkg gobject-2.0 \
-       --pkg folks \
-       --pkg build-conf \
+       $(backend_library_valaflags_generic) \
        --pkg telepathy-glib \
        --library tp-zeitgeist-dummy \
        --vapi tp-zeitgeist-dummy.vapi \
        -H tp-zeitgeist-dummy.h \
-       -g \
        $(NULL)
 
 
@@ -190,10 +150,6 @@ endif
 # Support library
 ##################################################################
 
-pkgconfig_in = folks-telepathy.pc.in
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = $(pkgconfig_in:.in=)
-
 FOLKS_TP_VALA_DEPS = tp-lowlevel.vapi
 if ENABLE_ZEITGEIST
 FOLKS_TP_VALA_DEPS += tp-zeitgeist.vapi
@@ -212,27 +168,9 @@ libfolks_telepathy_la_SOURCES = \
        $(NULL)
 
 libfolks_telepathy_la_VALAFLAGS = \
-       $(AM_VALAFLAGS) \
-       $(TARGET_VALAFLAGS) \
-       $(ERROR_VALAFLAGS) \
-       --gir=FolksTelepathy-$(API_VERSION_DOT).gir \
-       --library=folks-telepathy \
-       --vapidir=$(abs_srcdir) \
-       --vapidir=$(abs_builddir) \
-       --vapidir=$(abs_top_srcdir)/folks \
-       --vapidir=$(abs_top_builddir)/folks \
-       --pkg folks \
-       --pkg folks-generics \
-       --pkg folks-internal \
+       $(backend_library_valaflags) \
        --pkg tp-lowlevel \
-       --pkg gobject-2.0 \
-       --pkg gio-2.0 \
-       --pkg gee-0.8 \
        --pkg telepathy-glib \
-       --includedir folks \
-       --library folks-telepathy \
-       --vapi folks-telepathy.vapi \
-       -H folks/folks-telepathy.h \
        $(NULL)
 
 if ENABLE_ZEITGEIST
@@ -242,26 +180,17 @@ libfolks_telepathy_la_VALAFLAGS += --pkg tp-zeitgeist-dummy
 endif
 
 libfolks_telepathy_la_CPPFLAGS = \
-       $(AM_CPPFLAGS) \
-       -include $(top_srcdir)/folks/warnings.h \
+       $(backend_library_cppflags) \
        $(NULL)
 
 libfolks_telepathy_la_CFLAGS = \
-       $(AM_CFLAGS) \
-       $(CODE_COVERAGE_CFLAGS) \
-       $(GIO_CFLAGS) \
-       $(GLIB_CFLAGS) \
-       $(GEE_CFLAGS) \
+       $(backend_library_cflags) \
        $(TP_GLIB_CFLAGS) \
        $(NULL)
 
 libfolks_telepathy_la_LIBADD = \
-       $(AM_LIBADD) \
-       $(GIO_LIBS) \
-       $(GLIB_LIBS) \
-       $(GEE_LIBS) \
+       $(backend_library_libadd) \
        $(TP_GLIB_LIBS) \
-       $(top_builddir)/folks/libfolks.la \
        $(NULL)
 
 if ENABLE_ZEITGEIST
@@ -270,25 +199,8 @@ else
 libfolks_telepathy_la_LIBADD += libtp-zeitgeist-dummy.la
 endif
 
-# The quoting here is unnecessary but harmless, and has the useful side-effect
-# that vim quickfix mode (:make) doesn't interpret the libtool --mode=link
-# command as an error message in a bizarrely named file
 libfolks_telepathy_la_LDFLAGS = \
-       $(AM_LDFLAGS) \
-       $(CODE_COVERAGE_LDFLAGS) \
-       -version-info "$(FOLKS_TELEPATHY_LT_VERSION)" \
-       -export-symbols-regex "^tpf_.*" \
-       $(NULL)
-
-folks_telepathy_includedir = $(includedir)/folks
-folks_telepathy_include_HEADERS = \
-       folks/folks-telepathy.h \
-       $(NULL)
-
-vapidir = $(datadir)/vala/vapi
-dist_vapi_DATA = \
-       folks-telepathy.vapi \
-       folks-telepathy.deps \
+       $(backend_library_ldflags) \
        $(NULL)
 
 ##################################################################
@@ -299,11 +211,8 @@ if NOT_RELEASE
 DISTCLEANFILES = $(dist_noinst_DATA)
 endif
 
-MAINTAINERCLEANFILES =
 EXTRA_DIST += \
        $(libtp_lowlevel_la_SOURCES) \
-       $(pkgconfig_in) \
-       $(MAINTAINERCLEANFILES) \
        $(NULL)
 
 # XXX: headers separated because automake erroneously treats all libraries in
@@ -315,26 +224,9 @@ noinst_HEADERS = $(tp_lowlevel_headers)
 # Introspection
 ##################################################################
 
--include $(INTROSPECTION_MAKEFILE)
 INTROSPECTION_GIRS =
-INTROSPECTION_SCANNER_ARGS = \
-       $(ERROR_INTROSPECTION_SCANNER_ARGS) \
-       --add-include-path=$(srcdir) \
-       --add-include-path=$(abs_top_builddir)/folks \
-       --warn-all \
-       $(NULL)
-
-# Set PKG_CONFIG_PATH so we can find the backend's uninstalled pkg-config file.
-INTROSPECTION_SCANNER_ENV = \
-       PKG_CONFIG_PATH=$(top_builddir)/folks:$${PKG_CONFIG_PATH}
-
 DISTCHECK_CONFIGURE_FLAGS = --enable-introspection
 
-INTROSPECTION_COMPILER_ARGS = \
-       --includedir=$(srcdir) \
-       --includedir=$(abs_top_builddir)/folks \
-       $(NULL)
-
 #------------------------------------
 # TpLowlevel
 #------------------------------------
@@ -356,25 +248,6 @@ dist_noinst_DATA += \
 
 TpLowlevel-$(API_VERSION_DOT).gir: libtp-lowlevel.la
 
-#------------------------------------
-# Folks Telepathy
-#------------------------------------
-
-if HAVE_INTROSPECTION
-FolksTelepathy-$(API_VERSION_DOT).gir: libfolks-telepathy.la
-GIRS = FolksTelepathy-$(API_VERSION_DOT).gir
-
-girdir = $(datadir)/gir-1.0
-dist_gir_DATA = $(GIRS)
-
-MAINTAINERCLEANFILES += $(dist_gir_DATA)
-
-typelibdir = $(libdir)/girepository-1.0
-nodist_typelib_DATA = $(GIRS:.gir=.typelib)
-
-CLEANFILES += $(nodist_typelib_DATA)
-endif
-
 ##################################################################
 # Common
 ##################################################################
diff --git a/backends/tracker/lib/Makefile.am b/backends/tracker/lib/Makefile.am
index 48b0177..5b23b07 100644
--- a/backends/tracker/lib/Makefile.am
+++ b/backends/tracker/lib/Makefile.am
@@ -1,10 +1,15 @@
-BACKEND_NAME = "tracker"
+CLEANFILES =
+MAINTAINERCLEANFILES =
+EXTRA_DIST =
 
-lib_LTLIBRARIES = libfolks-tracker.la
+include $(top_srcdir)/backends/backend-library.mk
 
-pkgconfig_in = folks-tracker.pc.in
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = $(pkgconfig_in:.in=)
+BACKEND_NAME = tracker
+BACKEND_NAME_C = Tracker
+BACKEND_LT_VERSION = $(FOLKS_TRACKER_LT_VERSION)
+BACKEND_SYMBOLS_REGEX = "^(TRF|trf)_.*|"
+
+lib_LTLIBRARIES = libfolks-tracker.la
 
 libfolks_tracker_la_SOURCES = \
        trf-namespace.vala \
@@ -14,123 +19,27 @@ libfolks_tracker_la_SOURCES = \
        $(NULL)
 
 libfolks_tracker_la_VALAFLAGS = \
-       $(AM_VALAFLAGS) \
-       $(TARGET_VALAFLAGS) \
-       $(ERROR_VALAFLAGS) \
-       --vapidir=. \
-       --vapidir=$(top_srcdir)/folks \
-       --pkg folks \
-       --pkg folks-generics \
-       --pkg folks-internal \
-       --pkg gobject-2.0 \
-       --pkg gio-2.0 \
-       --pkg gee-0.8 \
+       $(backend_library_valaflags) \
        --pkg tracker-sparql-$(TRACKER_SPARQL_MAJOR) \
-       --includedir folks \
-       --gir FolksTracker-$(API_VERSION_DOT).gir \
-       --library folks-tracker \
-       --vapi folks-tracker.vapi \
-       -H folks/folks-tracker.h \
        $(NULL)
 
 libfolks_tracker_la_CPPFLAGS = \
-       -I$(top_srcdir) \
-       -I$(top_srcdir)/folks \
-       -include $(CONFIG_HEADER) \
-       -include $(top_srcdir)/folks/warnings.h \
-       -DPACKAGE_DATADIR=\"$(pkgdatadir)\" \
-       -DBACKEND_NAME=\"$(BACKEND_NAME)\" \
-       -DG_LOG_DOMAIN=\"$(BACKEND_NAME)\" \
+       $(backend_library_cppflags) \
        $(NULL)
 
 libfolks_tracker_la_CFLAGS = \
-       $(AM_CFLAGS) \
-       $(ERROR_CFLAGS) \
-       $(CODE_COVERAGE_CFLAGS) \
-       $(GIO_CFLAGS) \
-       $(GLIB_CFLAGS) \
-       $(GEE_CFLAGS) \
+       $(backend_library_cflags) \
        $(TRACKER_SPARQL_CFLAGS) \
        $(NULL)
 
 libfolks_tracker_la_LIBADD = \
-       $(AM_LIBADD) \
-       $(GIO_LIBS) \
-       $(GLIB_LIBS) \
-       $(GEE_LIBS) \
-       $(top_builddir)/folks/libfolks.la \
+       $(backend_library_libadd) \
        $(TRACKER_SPARQL_LIBS) \
        $(NULL)
 
-# The quoting here is unnecessary but harmless, and has the useful side-effect
-# that vim quickfix mode (:make) doesn't interpret the libtool --mode=link
-# command as an error message in a bizarrely named file
 libfolks_tracker_la_LDFLAGS = \
-       $(AM_LDFLAGS) \
-       $(CODE_COVERAGE_LDFLAGS) \
-       -version-info "$(FOLKS_TRACKER_LT_VERSION)" \
-       -export-symbols-regex "^(TRF|trf)_.*|" \
-       $(NULL)
-
-folks_tracker_includedir = $(includedir)/folks
-folks_tracker_include_HEADERS = \
-       folks/folks-tracker.h \
-       $(NULL)
-
-vapidir = $(datadir)/vala/vapi
-dist_vapi_DATA = \
-       folks-tracker.vapi \
-       folks-tracker.deps \
-       $(NULL)
-
-##################################################################
-# General
-##################################################################
-
-CLEANFILES =
-MAINTAINERCLEANFILES =
-EXTRA_DIST = \
-       $(pkgconfig_in) \
-       $(MAINTAINERCLEANFILES) \
-       $(NULL)
-
-##################################################################
-# Introspection
-##################################################################
--include $(INTROSPECTION_MAKEFILE)
-INTROSPECTION_SCANNER_ARGS = \
-       $(ERROR_INTROSPECTION_SCANNER_ARGS) \
-       --add-include-path=$(srcdir) \
-       --add-include-path=$(abs_top_builddir)/folks \
-       --warn-all \
-       $(NULL)
-
-# Set PKG_CONFIG_PATH so we can find the backend's uninstalled pkg-config file.
-INTROSPECTION_SCANNER_ENV = \
-       PKG_CONFIG_PATH=$(top_builddir)/folks:$${PKG_CONFIG_PATH}
-
-INTROSPECTION_COMPILER_ARGS = \
-       --includedir=$(srcdir) \
-       --includedir=$(abs_top_builddir)/folks \
+       $(backend_library_ldflags) \
        $(NULL)
 
-if HAVE_INTROSPECTION
-FolksTracker-$(API_VERSION_DOT).gir: libfolks-tracker.la
-GIRS = FolksTracker-$(API_VERSION_DOT).gir
-
-girdir = $(datadir)/gir-1.0
-dist_gir_DATA = $(GIRS)
-
-MAINTAINERCLEANFILES += $(dist_gir_DATA)
-
-typelibdir = $(libdir)/girepository-1.0
-nodist_typelib_DATA = $(GIRS:.gir=.typelib)
-
-CLEANFILES += $(nodist_typelib_DATA)
-endif
-
-##################################################################
-# Common
-##################################################################
 
 -include $(top_srcdir)/git.mk
diff --git a/configure.ac b/configure.ac
index bb2e7ba..9012fd5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -392,7 +392,6 @@ AS_IF([test "x$enable_vala" = "xyes"], [
         # within the libfolks tree, select inline code paths
         TARGET_VALAFLAGS="$TARGET_VALAFLAGS -D FOLKS_COMPILATION"
         AC_SUBST([TARGET_VALAFLAGS])
-        AC_SUBST([VAPIGENFLAGS])
         AC_SUBST([VAPIDIR])
 
         VALA_CHECK_PACKAGES([gio-2.0
diff --git a/tests/lib/telepathy/contactlist/Makefile.am b/tests/lib/telepathy/contactlist/Makefile.am
index d5ce41e..65872c9 100644
--- a/tests/lib/telepathy/contactlist/Makefile.am
+++ b/tests/lib/telepathy/contactlist/Makefile.am
@@ -4,7 +4,7 @@
 # copy-and-modify (moving it to a better namespace), or make changes in the
 # copy in telepathy-glib first.
 
-VAPIGENFLAGS += \
+VAPIGENFLAGS = \
        --vapidir=. \
        --pkg gobject-2.0 \
        --pkg gio-2.0 \


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]