[folks] build: Use target-specific VALAFLAGS rather than AM_VALAFLAGS



commit 037caf3a4d1d1b8de5fb6c4d78887793f36700a8
Author: Philip Withnall <philip tecnocode co uk>
Date:   Thu Jun 20 17:21:41 2013 +0100

    build: Use target-specific VALAFLAGS rather than AM_VALAFLAGS
    
    This allows automake to parse the flags for each target and generate
    appropriate rules. For example, by explicitly specifying “--vapi foo.vapi” in
    foo_VALAFLAGS (not just specifying “--library foo”), dependency and clean-up
    rules for foo.vapi will be generated by automake. Accordingly, this commit
    also adds missing --vapi flags.
    
    Helps: https://bugzilla.gnome.org/show_bug.cgi?id=701099

 backends/eds/Makefile.am              |   32 +++++++++++++---------------
 backends/eds/lib/Makefile.am          |    6 -----
 backends/libsocialweb/Makefile.am     |   21 ++++++++-----------
 backends/libsocialweb/lib/Makefile.am |   36 ++++++++++++--------------------
 backends/telepathy/Makefile.am        |   21 ++++++++-----------
 backends/telepathy/lib/Makefile.am    |    1 +
 backends/tracker/Makefile.am          |   27 +++++++++++-------------
 backends/tracker/lib/Makefile.am      |   11 +---------
 folks/Makefile.am                     |   11 ----------
 tests/lib/Makefile.am                 |    7 +++++-
 tests/lib/eds/Makefile.am             |   12 ++++++----
 tests/lib/key-file/Makefile.am        |   12 ++++++----
 tests/lib/libsocialweb/Makefile.am    |   12 ++++++----
 tests/lib/telepathy/Makefile.am       |   16 ++++++++------
 tests/lib/tracker/Makefile.am         |   16 ++++++--------
 tests/telepathy/Makefile.am           |    9 --------
 16 files changed, 104 insertions(+), 146 deletions(-)
---
diff --git a/backends/eds/Makefile.am b/backends/eds/Makefile.am
index 60c9426..af242ff 100644
--- a/backends/eds/Makefile.am
+++ b/backends/eds/Makefile.am
@@ -2,34 +2,32 @@ SUBDIRS = lib
 
 BACKEND_NAME = "eds"
 
-AM_VALAFLAGS += \
+backenddir = $(BACKEND_DIR)/eds
+backend_LTLIBRARIES = eds.la
+
+eds_la_VALAFLAGS = \
+       $(AM_VALAFLAGS) \
        $(ERROR_VALAFLAGS) \
        --vapidir=. \
        --vapidir=$(top_builddir)/backends/eds/lib \
        --vapidir=$(top_srcdir)/folks \
-       $(addprefix --pkg ,$(eds_deps)) \
+       --vapidir=$(top_builddir)/folks \
+       --pkg folks \
+       --pkg folks-internal \
+       --pkg folks-eds \
+       --pkg gee-0.8 \
+       --pkg gio-2.0 \
+       --pkg gobject-2.0 \
+       --pkg libebook-1.2 \
+       --pkg libedataserver-1.2 \
+       --pkg libxml-2.0 \
        $(NULL)
 
-backenddir = $(BACKEND_DIR)/eds
-backend_LTLIBRARIES = eds.la
-
 eds_la_SOURCES = \
        eds-backend.vala \
        eds-backend-factory.vala \
        $(NULL)
 
-eds_deps = \
-       folks \
-       folks-internal \
-       folks-eds \
-       gee-0.8 \
-       gio-2.0 \
-       gobject-2.0 \
-       libebook-1.2 \
-       libedataserver-1.2 \
-       libxml-2.0 \
-       $(NULL)
-
 eds_la_CPPFLAGS = \
        -I$(top_srcdir) \
        -I$(top_srcdir)/folks \
diff --git a/backends/eds/lib/Makefile.am b/backends/eds/lib/Makefile.am
index 4223bda..3c5718b 100644
--- a/backends/eds/lib/Makefile.am
+++ b/backends/eds/lib/Makefile.am
@@ -26,8 +26,6 @@ pkgconfig_in = folks-eds.pc.in
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = $(pkgconfig_in:.in=)
 
-libfolks_eds_la_vala.stamp:
-
 folks_eds_valasources = \
        edsf-namespace.vala \
        edsf-persona.vala \
@@ -39,10 +37,6 @@ libfolks_eds_la_SOURCES = \
        $(folks_eds_valasources) \
        $(NULL)
 
-# XXX: it would be nice to do something like this below:
-#    $(addprefix --pkg ,$(folks_backend_eds_deps)) \
-# to factor out repetition, but automake's Vala support doesn't like it
-# because it assumes it can simply match every flag in any _VALAFLAGS string.
 libfolks_eds_la_VALAFLAGS = \
        $(AM_VALAFLAGS) \
        $(ERROR_VALAFLAGS) \
diff --git a/backends/libsocialweb/Makefile.am b/backends/libsocialweb/Makefile.am
index 67a3529..0f608d6 100644
--- a/backends/libsocialweb/Makefile.am
+++ b/backends/libsocialweb/Makefile.am
@@ -2,12 +2,19 @@ SUBDIRS = lib
 
 BACKEND_NAME = "libsocialweb"
 
-AM_VALAFLAGS += \
+libsocialweb_la_VALAFLAGS = \
+       $(AM_VALAFLAGS) \
        $(ERROR_VALAFLAGS) \
        --vapidir=. \
        --vapidir=$(top_builddir)/backends/libsocialweb/lib \
        --vapidir=$(top_srcdir)/folks \
-       $(addprefix --pkg ,$(libsocialweb_deps)) \
+       --pkg folks \
+       --pkg folks-internal \
+       --pkg folks-libsocialweb \
+       --pkg gee-0.8 \
+       --pkg gio-2.0 \
+       --pkg gobject-2.0 \
+       --pkg libsocialweb-client \
        $(NULL)
 
 backenddir = $(BACKEND_DIR)/libsocialweb
@@ -18,16 +25,6 @@ libsocialweb_la_SOURCES = \
        sw-backend-factory.vala \
        $(NULL)
 
-libsocialweb_deps = \
-       folks \
-       folks-internal \
-       folks-libsocialweb \
-       gee-0.8 \
-       gio-2.0 \
-       gobject-2.0 \
-       libsocialweb-client \
-       $(NULL)
-
 libsocialweb_la_CPPFLAGS = \
        -I$(top_srcdir) \
        -I$(top_srcdir)/folks \
diff --git a/backends/libsocialweb/lib/Makefile.am b/backends/libsocialweb/lib/Makefile.am
index 04074ce..f07cb60 100644
--- a/backends/libsocialweb/lib/Makefile.am
+++ b/backends/libsocialweb/lib/Makefile.am
@@ -25,8 +25,6 @@ pkgconfig_in = folks-libsocialweb.pc.in
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = $(pkgconfig_in:.in=)
 
-libfolks_libsocialweb_la_vala.stamp:
-
 folks_libsocialweb_valasources = \
        swf-namespace.vala \
        swf-persona.vala \
@@ -38,27 +36,21 @@ libfolks_libsocialweb_la_SOURCES = \
        $(NULL)
 
 libfolks_libsocialweb_la_VALAFLAGS = \
+       $(AM_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 \
-        --pkg libsocialweb-client \
-        --includedir folks \
-        --vapi folks-libsocialweb.vapi \
-        -H folks/folks-libsocialweb.h \
-        $(NULL)
-
-folks_backend_libsocialweb_deps = \
-       folks \
-       gee-0.8 \
-       gio-2.0 \
-       gobject-2.0 \
-       libsocialweb-client \
+       --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 \
+       --pkg libsocialweb-client \
+       --includedir folks \
+       --library folks-libsocialweb \
+       --vapi folks-libsocialweb.vapi \
+       -H folks/folks-libsocialweb.h \
        $(NULL)
 
 libfolks_libsocialweb_la_CFLAGS = \
diff --git a/backends/telepathy/Makefile.am b/backends/telepathy/Makefile.am
index 0e5bf5a..d22d969 100644
--- a/backends/telepathy/Makefile.am
+++ b/backends/telepathy/Makefile.am
@@ -2,7 +2,8 @@ SUBDIRS = lib
 
 BACKEND_NAME = "telepathy"
 
-AM_VALAFLAGS += \
+telepathy_la_VALAFLAGS = \
+       $(AM_VALAFLAGS) \
        $(ERROR_VALAFLAGS) \
        --vapidir=$(abs_srcdir) \
        --vapidir=$(abs_builddir) \
@@ -10,7 +11,13 @@ AM_VALAFLAGS += \
        --vapidir=$(abs_top_builddir)/backends/telepathy/lib \
        --vapidir=$(abs_top_srcdir)/folks \
        --vapidir=$(abs_top_builddir)/folks \
-       $(addprefix --pkg ,$(telepathy_deps)) \
+       --pkg folks \
+       --pkg folks-internal \
+       --pkg folks-telepathy \
+       --pkg gee-0.8 \
+       --pkg gio-2.0 \
+       --pkg gobject-2.0 \
+       --pkg telepathy-glib \
        $(NULL)
 
 backenddir = $(BACKEND_DIR)/telepathy
@@ -21,16 +28,6 @@ telepathy_la_SOURCES = \
        tp-backend-factory.vala \
        $(NULL)
 
-telepathy_deps = \
-       folks \
-       folks-internal \
-       folks-telepathy \
-       gee-0.8 \
-       gio-2.0 \
-       gobject-2.0 \
-       telepathy-glib \
-       $(NULL)
-
 telepathy_la_CPPFLAGS = \
        -I$(top_srcdir) \
        -I$(top_srcdir)/folks \
diff --git a/backends/telepathy/lib/Makefile.am b/backends/telepathy/lib/Makefile.am
index 24e2897..020af79 100644
--- a/backends/telepathy/lib/Makefile.am
+++ b/backends/telepathy/lib/Makefile.am
@@ -112,6 +112,7 @@ libfolks_telepathy_la_VALAFLAGS = \
        --pkg telepathy-glib \
        $(ZEITGEIST_PKG) \
        --includedir folks \
+       --library folks-telepathy \
        --vapi folks-telepathy.vapi \
        -H folks/folks-telepathy.h \
        $(NULL)
diff --git a/backends/tracker/Makefile.am b/backends/tracker/Makefile.am
index 4fa10d3..fc8ff0b 100644
--- a/backends/tracker/Makefile.am
+++ b/backends/tracker/Makefile.am
@@ -2,33 +2,30 @@ SUBDIRS = lib
 
 BACKEND_NAME = "tracker"
 
-AM_VALAFLAGS += \
+backenddir = $(BACKEND_DIR)/tracker
+backend_LTLIBRARIES = tracker.la
+
+tracker_la_VALAFLAGS = \
+       $(AM_VALAFLAGS) \
        $(ERROR_VALAFLAGS) \
        --vapidir=. \
        --vapidir=vapi \
        --vapidir=$(top_builddir)/backends/tracker/lib \
        --vapidir=$(top_srcdir)/folks \
-       $(addprefix --pkg ,$(tracker_deps)) \
+       --pkg folks \
+       --pkg folks-internal \
+       --pkg folks-tracker \
+       --pkg gee-0.8 \
+       --pkg gio-2.0 \
+       --pkg gobject-2.0 \
+       --pkg tracker-sparql-$(TRACKER_SPARQL_MAJOR) \
        $(NULL)
 
-backenddir = $(BACKEND_DIR)/tracker
-backend_LTLIBRARIES = tracker.la
-
 tracker_la_SOURCES = \
        tr-backend.vala \
        tr-backend-factory.vala \
        $(NULL)
 
-tracker_deps = \
-       folks \
-       folks-internal \
-       folks-tracker \
-       gee-0.8 \
-       gio-2.0 \
-       gobject-2.0 \
-       tracker-sparql-$(TRACKER_SPARQL_MAJOR) \
-       $(NULL)
-
 tracker_la_CPPFLAGS = \
        -I$(top_srcdir) \
        -I$(top_srcdir)/folks \
diff --git a/backends/tracker/lib/Makefile.am b/backends/tracker/lib/Makefile.am
index 13b3df8..470d673 100644
--- a/backends/tracker/lib/Makefile.am
+++ b/backends/tracker/lib/Makefile.am
@@ -7,8 +7,6 @@ pkgconfig_in = folks-tracker.pc.in
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = $(pkgconfig_in:.in=)
 
-libfolks_tracker_la_vala.stamp:
-
 folks_tracker_valasources = \
        trf-namespace.vala \
        trf-persona.vala \
@@ -33,18 +31,11 @@ libfolks_tracker_la_VALAFLAGS = \
        --pkg gee-0.8 \
        --pkg tracker-sparql-$(TRACKER_SPARQL_MAJOR) \
        --includedir folks \
+       --library folks-tracker \
        --vapi folks-tracker.vapi \
        -H folks/folks-tracker.h \
        $(NULL)
 
-folks_backend_tracker_deps = \
-       folks \
-       gee-0.8 \
-       gio-2.0 \
-       gobject-2.0 \
-       tracker-sparql-$(TRACKER_SPARQL_MAJOR) \
-       $(NULL)
-
 libfolks_tracker_la_CPPFLAGS = \
        -I$(top_srcdir) \
        -I$(top_srcdir)/folks \
diff --git a/folks/Makefile.am b/folks/Makefile.am
index f91f3d7..29833bc 100644
--- a/folks/Makefile.am
+++ b/folks/Makefile.am
@@ -173,13 +173,6 @@ EXTRA_DIST = \
        redeclare-internal-api.h \
        $(NULL)
 
-BUILT_SOURCES = \
-       folks-internal.h \
-       folks-internal.vapi \
-       folks.h \
-       folks.vapi \
-       $(NULL)
-
 CLEANFILES =
 MAINTAINERCLEANFILES =
 
@@ -208,10 +201,6 @@ nodist_typelib_DATA = $(GIRS:.gir=.typelib)
 CLEANFILES += $(nodist_typelib_DATA)
 endif
 
-MAINTAINERCLEANFILES += \
-       $(BUILT_SOURCES) \
-       $(NULL)
-
 ##################################################
 # GSettings
 ##################################################
diff --git a/tests/lib/Makefile.am b/tests/lib/Makefile.am
index efd22de..0ce1099 100644
--- a/tests/lib/Makefile.am
+++ b/tests/lib/Makefile.am
@@ -84,13 +84,18 @@ libfolks_test_la_VALAFLAGS = \
        --pkg folks \
        --pkg build-conf \
        --library folks-test \
+       --vapi folks-test.vapi \
        -H folks-test.h \
        -h folks-test-internal.h \
        -g \
        $(NULL)
 
+# According to the following document, this is the best way to ensure that this header
+# gets built when compiling the Vala sources to C but before we try to compile
+# all the C files (in case of parallel builds):
+#     http://www.lug.or.kr/docs/automake/Dependency-Tracking-Evolution.html
 BUILT_SOURCES = \
-       libfolks_test_la_vala.stamp \
+       folks-test-internal.h \
        $(NULL)
 
 MAINTAINERCLEANFILES = \
diff --git a/tests/lib/eds/Makefile.am b/tests/lib/eds/Makefile.am
index 7157b09..6cc994c 100644
--- a/tests/lib/eds/Makefile.am
+++ b/tests/lib/eds/Makefile.am
@@ -1,7 +1,11 @@
-AM_VALAFLAGS += \
+noinst_LTLIBRARIES = libeds-test.la
+
+libeds_test_la_VALAFLAGS = \
        $(ERROR_VALAFLAGS) \
-       --library=eds-test \
-       --header=eds-test.h \
+       $(AM_VALAFLAGS) \
+       --library eds-test \
+       --vapi eds-test.vapi \
+       --header eds-test.h \
        --vapidir=$(top_srcdir)/folks \
        --vapidir=$(top_srcdir)/backends/eds/lib \
        --vapidir=$(top_srcdir)/backends/eds/vapi \
@@ -20,8 +24,6 @@ AM_VALAFLAGS += \
        -g \
        $(NULL)
 
-noinst_LTLIBRARIES = libeds-test.la
-
 libeds_test_la_SOURCES = \
        backend.vala \
        test-case.vala \
diff --git a/tests/lib/key-file/Makefile.am b/tests/lib/key-file/Makefile.am
index e7de2a5..52a3047 100644
--- a/tests/lib/key-file/Makefile.am
+++ b/tests/lib/key-file/Makefile.am
@@ -1,7 +1,11 @@
-AM_VALAFLAGS += \
+noinst_LTLIBRARIES = libkf-test.la
+
+libkf_test_la_VALAFLAGS = \
        $(ERROR_VALAFLAGS) \
-       --library=kf-test \
-       --header=kf-test.h \
+       $(AM_VALAFLAGS) \
+       --library kf-test \
+       --vapi kf-test.vapi \
+       --header kf-test.h \
        --vapidir=$(abs_srcdir) \
        --vapidir=$(abs_builddir) \
        --vapidir=$(abs_top_srcdir)/folks \
@@ -12,8 +16,6 @@ AM_VALAFLAGS += \
        -g \
        $(NULL)
 
-noinst_LTLIBRARIES = libkf-test.la
-
 libkf_test_la_SOURCES = \
        backend.vala \
        test-case.vala \
diff --git a/tests/lib/libsocialweb/Makefile.am b/tests/lib/libsocialweb/Makefile.am
index daf5346..4f2e31c 100644
--- a/tests/lib/libsocialweb/Makefile.am
+++ b/tests/lib/libsocialweb/Makefile.am
@@ -1,7 +1,11 @@
-AM_VALAFLAGS += \
+noinst_LTLIBRARIES = libsocialweb-test.la
+
+libsocialweb_test_la_VALAFLAGS = \
        $(ERROR_VALAFLAGS) \
-       --library=libsocialweb-test \
-       --header=libsocialweb-test.h \
+       $(AM_VALAFLAGS) \
+       --library libsocialweb-test \
+       --vapi libsocialweb-test.vapi \
+       --header libsocialweb-test.h \
        --vapidir=$(top_srcdir)/folks \
        --vapidir=$(top_srcdir)/backends/libsocialweb/lib \
        --vapidir=$(abs_top_srcdir)/tests/lib \
@@ -17,8 +21,6 @@ AM_VALAFLAGS += \
        -g \
        $(NULL)
 
-noinst_LTLIBRARIES = libsocialweb-test.la
-
 libsocialweb_test_la_SOURCES = \
        backend.vala \
        test-case.vala \
diff --git a/tests/lib/telepathy/Makefile.am b/tests/lib/telepathy/Makefile.am
index cd5368f..1174bcc 100644
--- a/tests/lib/telepathy/Makefile.am
+++ b/tests/lib/telepathy/Makefile.am
@@ -1,11 +1,15 @@
 SUBDIRS = \
-        contactlist \
-        $(NULL)
+       contactlist \
+       $(NULL)
+
+noinst_LTLIBRARIES = libtpf-test.la
 
-AM_VALAFLAGS += \
+libtpf_test_la_VALAFLAGS = \
        $(ERROR_VALAFLAGS) \
-       --library=tpf-test \
-       --header=tpf-test.h \
+       $(AM_VALAFLAGS) \
+       --library tpf-test \
+       --vapi tpf-test.vapi \
+       --header tpf-test.h \
        --vapidir=$(abs_srcdir) \
        --vapidir=$(abs_builddir) \
        --vapidir=$(abs_srcdir)/contactlist \
@@ -22,8 +26,6 @@ AM_VALAFLAGS += \
        -g \
        $(NULL)
 
-noinst_LTLIBRARIES = libtpf-test.la
-
 libtpf_test_la_SOURCES = \
        test-case.vala \
        $(NULL)
diff --git a/tests/lib/tracker/Makefile.am b/tests/lib/tracker/Makefile.am
index 14f2358..ddd9549 100644
--- a/tests/lib/tracker/Makefile.am
+++ b/tests/lib/tracker/Makefile.am
@@ -1,7 +1,11 @@
-AM_VALAFLAGS += \
+noinst_LTLIBRARIES = libtracker-test.la
+
+libtracker_test_la_VALAFLAGS = \
        $(ERROR_VALAFLAGS) \
-       --library=tracker-test \
-       --header=tracker-test.h \
+       $(AM_VALAFLAGS) \
+       --library tracker-test \
+       --vapi tracker-test.vapi \
+       --header tracker-test.h \
        --vapidir=$(top_srcdir)/folks \
        --vapidir=$(top_srcdir)/backends/tracker/lib \
        --vapidir=$(abs_top_srcdir)/tests/lib \
@@ -17,8 +21,6 @@ AM_VALAFLAGS += \
        -g \
        $(NULL)
 
-noinst_LTLIBRARIES = libtracker-test.la
-
 libtracker_test_la_SOURCES = \
        backend.vala \
        test-case.vala \
@@ -46,10 +48,6 @@ libtracker_test_la_LIBADD = \
        $(top_builddir)/tests/lib/libfolks-test.la \
        $(NULL)
 
-# XXX: automake's Vala support should make these unnecessary
-tracker-test.vapi: libtracker_test_la_vala.stamp
-tracker-test.h: libtracker_test_la_vala.stamp
-
 dist_noinst_DATA = \
        tracker-test.vapi \
        $(NULL)
diff --git a/tests/telepathy/Makefile.am b/tests/telepathy/Makefile.am
index f3339e4..7049780 100644
--- a/tests/telepathy/Makefile.am
+++ b/tests/telepathy/Makefile.am
@@ -104,15 +104,6 @@ persona_store_capabilities_SOURCES = \
        persona-store-capabilities.vala \
        $(NULL)
 
-BUILT_SOURCES = \
-       fake_tp_backend_vala.stamp \
-       individual_properties_vala.stamp \
-       individual_retrieval_vala.stamp \
-       individual_zeitgeist_vala.stamp \
-       init_vala.stamp \
-       persona_store_capabilities_vala.stamp \
-       $(NULL)
-
 CLEANFILES = \
        *.pid \
        *.address \



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