[gitg/wip/release: 4/21] Cleanup use of CFLAGS, CPPFLAGS, LDFLAGS and LIBADD



commit cf755f9e731df529054375c9893bf8a29bb390df
Author: Jesse van den Kieboom <jessevdk gmail com>
Date:   Fri Jan 3 19:29:45 2014 +0100

    Cleanup use of CFLAGS, CPPFLAGS, LDFLAGS and LIBADD

 gitg/Makefile.am          |   35 ++++++++++++++++-----------------
 libgitg-ext/Makefile.am   |   47 ++++++++++++++++++++++++++------------------
 libgitg/Makefile.am       |   27 +++++++++++++------------
 plugins/diff/Makefile.am  |   11 +++++----
 plugins/files/Makefile.am |   13 ++++++-----
 tests/Makefile.am         |   24 ++++++++++++++++++----
 6 files changed, 91 insertions(+), 66 deletions(-)
---
diff --git a/gitg/Makefile.am b/gitg/Makefile.am
index cea2e78..d602f8f 100644
--- a/gitg/Makefile.am
+++ b/gitg/Makefile.am
@@ -1,16 +1,19 @@
 bin_PROGRAMS = gitg
 
-AM_CPPFLAGS =                                                  \
+gitg_CPPFLAGS =                                                        \
        -I$(top_srcdir)                                         \
        -I$(srcdir)                                             \
        -I$(top_srcdir)/libgd                                   \
-       $(GITG_CFLAGS)                                          \
-       $(WARN_CFLAGS)                                          \
        -DDATADIR=\""$(datadir)"\"                              \
        -DGITG_DATADIR=\""$(datadir)/gitg"\"                    \
        -DGITG_LOCALEDIR=\""$(datadir)/locale"\"
 
-AM_VALAFLAGS = \
+gitg_CFLAGS =                                                  \
+       $(GITG_CFLAGS)                                          \
+       $(WARN_CFLAGS)                                          \
+       -w
+
+gitg_VALAFLAGS =                                               \
        --vapidir $(top_srcdir)/vapi                            \
        $(GITG_VALAFLAGS)                                       \
        --pkg config                                            \
@@ -35,7 +38,16 @@ AM_VALAFLAGS = \
        --vapidir "$(top_builddir)/libgitg-ext"                 \
        --gresources "$(top_srcdir)/gitg/resources/gitg-resources.xml"
 
-VALASOURCES =                                                  \
+gitg_LDADD =                                                   \
+       $(GITG_LIBS)                                            \
+       $(PACKAGE_LIBS)                                         \
+       $(top_builddir)/libgd/libgd.la                          \
+       $(top_builddir)/libgitg/libgitg-1.0.la                  \
+       $(top_builddir)/libgitg-ext/libgitg-ext-1.0.la
+
+gitg_LDFLAGS = -export-dynamic -no-undefined -export-symbols-regex "^[[^_]].*"
+
+gitg_VALASOURCES =                                             \
        gitg.vala                                               \
        gitg-dirs.vala                                          \
        gitg-window.vala                                        \
@@ -69,15 +81,6 @@ gitg_SOURCES =                                                       \
        $(VALASOURCES)                                          \
        gitg-resources.c
 
-gitg_LDADD =                                                   \
-       $(GITG_LIBS)                                            \
-       $(PACKAGE_LIBS)                                         \
-       $(top_builddir)/libgd/libgd.la                          \
-       $(top_builddir)/libgitg/libgitg-1.0.la                  \
-       $(top_builddir)/libgitg-ext/libgitg-ext-1.0.la
-
-gitg_LDFLAGS = -export-dynamic -no-undefined -export-symbols-regex "^[[^_]].*"
-
 gitg-resources.c: resources/gitg-resources.xml $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies 
--sourcedir $(srcdir)/resources resources/gitg-resources.xml)
        $(GLIB_COMPILE_RESOURCES) --generate-source     \
                --sourcedir $(srcdir)/resources         \
@@ -88,10 +91,6 @@ gitg-resources.h: resources/gitg-resources.xml $(shell $(GLIB_COMPILE_RESOURCES)
                --sourcedir $(srcdir)/resources         \
                --target "$@" "$<"
 
-# Ignore all warnings for vala code...
-gitg_CFLAGS = \
-       -w
-
 EXTRA_DIST =                           \
        resources/gitg-resources.xml            \
        $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(srcdir)/resources 
resources/gitg-resources.xml)
diff --git a/libgitg-ext/Makefile.am b/libgitg-ext/Makefile.am
index 4c7be90..825d4b7 100644
--- a/libgitg-ext/Makefile.am
+++ b/libgitg-ext/Makefile.am
@@ -1,36 +1,42 @@
 lib_LTLIBRARIES = libgitg-ext-1.0.la
 
-AM_CPPFLAGS =                                                          \
-       -I$(top_srcdir)                                                 \
-       -I$(srcdir)                                                     \
-       $(LIBGITG_EXT_CFLAGS)                                           \
-       $(WARN_CFLAGS)                                                  \
-       -DDATADIR=\""$(datadir)"\"                                      \
+libgitg_ext_1_0_la_CPPFLAGS =                  \
+       -I$(top_srcdir)                         \
+       -I$(srcdir)                             \
+       -DDATADIR=\""$(datadir)"\"              \
        -DLIBDIR=\""$(libdir)"\"
 
-COMMON_VALA_FLAGS =                            \
+libgitg_ext_1_0_la_CFLAGS =                    \
+       $(LIBGITG_EXT_CFLAGS)                   \
+       $(WARN_CFLAGS)                          \
+       -w
+
+libgitg_ext_1_0_la_VALAPKGS =                  \
        --pkg Ggit-1.0                          \
        --pkg libgitg-1.0                       \
        --pkg gio-2.0                           \
        --pkg gtk+-3.0                          \
        --pkg libsoup-2.4                       \
        --pkg webkit2gtk-3.0                    \
-       --pkg gee-0.8                           \
+       --pkg gee-0.8
+
+libgitg_ext_1_0_la_VALAFLAGS =                         \
+       $(libgitg_ext_1_0_la_VALAPKGS)          \
        --basedir $(top_srcdir)                 \
        --vapidir $(top_srcdir)/vapi            \
-       --vapidir $(top_builddir)/libgitg
-
-AM_VALAFLAGS =                                         \
-       $(COMMON_VALA_FLAGS)                    \
+       --vapidir $(top_builddir)/libgitg       \
        --gir GitgExt-1.0.gir                   \
+       --vapi libgitg-ext-1.0.vapi             \
        --girdir $(top_builddir)/libgitg        \
        --includedir libgitg-ext                \
        --header libgitg-ext.h                  \
        --library libgitg-ext-1.0               \
        $(GITG_VALAFLAGS)
 
-libgitg_ext_1_0_la_LDFLAGS = \
-       -export-dynamic -no-undefined -export-symbols-regex "^[^_].*"
+libgitg_ext_1_0_la_LDFLAGS =                   \
+       -export-dynamic                         \
+       -no-undefined                           \
+       -export-symbols-regex "^[^_].*"
 
 libgitg_ext_1_0_la_LIBADD = $(LIBGITG_EXT_LIBS)
 
@@ -62,13 +68,16 @@ GitgExt-1.0.gir: libgitg-ext-1.0.la
 libgitg-ext-1.0.vapi: libgitg-ext-1.0.la
 libgitg-ext.h: libgitg-ext-1.0.la
 
-# Ignore all warnings for vala code...
-libgitg_ext_1_0_la_CFLAGS = \
-       -w
-
 if ENABLE_DOCS
 docs: $(VALA_FILES)
-       $(VALADOC) --directory $(top_builddir)/docs --package-name gitgext $(COMMON_VALA_FLAGS) $(VALA_FILES)
+       $(VALADOC)                              \
+       --directory $(top_builddir)/docs        \
+       --package-name gitgext                  \
+       $(libgitg_ext_1_0_la_VALAPKGS)          \
+       --basedir $(top_srcdir)                 \
+       --vapidir $(top_srcdir)/vapi            \
+       --vapidir $(top_builddir)/libgitg       \
+       $(VALA_FILES)
 else
 docs:
 endif
diff --git a/libgitg/Makefile.am b/libgitg/Makefile.am
index 37557e3..8641dca 100644
--- a/libgitg/Makefile.am
+++ b/libgitg/Makefile.am
@@ -1,20 +1,25 @@
 lib_LTLIBRARIES = libgitg-1.0.la
 
-AM_CPPFLAGS =                                                          \
-       -I$(top_srcdir)                                                 \
-       -I$(srcdir)                                                     \
-       $(LIBGITG_CFLAGS)                                               \
-       $(WARN_CFLAGS)                                                  \
-       -DDATADIR=\""$(datadir)"\"                                      \
-       -DLIBDIR=\""$(libdir)"\"                                        \
+libgitg_1_0_la_CPPFLAGS =                              \
+       -I$(top_srcdir)                                 \
+       -I$(srcdir)                                     \
+       -DDATADIR=\""$(datadir)"\"                      \
+       -DLIBDIR=\""$(libdir)"\"                        \
        -DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\"
 
+libgitg_1_0_la_CFLAGS =                \
+       $(LIBGITG_CFLAGS)       \
+       $(WARN_CFLAGS)          \
+       -w
+
 libgitg_1_0_la_LDFLAGS =               \
-       -export-dynamic -no-undefined -export-symbols-regex "^[^_].*"
+       -export-dynamic                 \
+       -no-undefined                   \
+       -export-symbols-regex "^[^_].*"
 
 libgitg_1_0_la_LIBADD = $(LIBGITG_LIBS)
 
-AM_VALAFLAGS =                                 \
+libgitg_1_0_la_VALAFLAGS =             \
        --pkg Ggit-1.0                  \
        --pkg gtk+-3.0                  \
        --pkg gio-2.0                   \
@@ -70,10 +75,6 @@ VALA_FILES =                                 \
        gitg-avatar-cache.vala                  \
        gitg-diff-stat.vala
 
-# Ignore all warnings for vala code...
-libgitg_1_0_la_CFLAGS =                \
-       -w
-
 libgitg_1_0_la_SOURCES =               \
        gitg-resources.c                \
        gitg-js-utils.c                 \
diff --git a/plugins/diff/Makefile.am b/plugins/diff/Makefile.am
index b685c25..887f9bd 100644
--- a/plugins/diff/Makefile.am
+++ b/plugins/diff/Makefile.am
@@ -1,10 +1,8 @@
 SUBDIRS = icons
 
-AM_CPPFLAGS =                                                          \
+libdiff_la_CPPFLAGS =                                                  \
        -I$(top_srcdir)                                                 \
        -I$(srcdir)                                                     \
-       $(GITG_PLUGIN_CFLAGS)                                           \
-       $(WARN_CFLAGS)                                                  \
        -DDATADIR=\""$(datadir)"\"                                      \
        -DLIBDIR=\""$(libdir)"\"
 
@@ -12,14 +10,17 @@ plugindir = $(GITG_PLUGIN_LIBDIR)
 plugin_LTLIBRARIES = libdiff.la
 plugin_DATA = diff.plugin
 
-AM_VALAFLAGS = $(GITG_PLUGIN_VALAFLAGS)
 VALA_SOURCES =                                                         \
        gitg-diff.vala
+libdiff_la_CFLAGS =                                                    \
+       $(GITG_PLUGIN_CFLAGS)                                           \
+       $(WARN_CFLAGS)                                                  \
+       -w
 
 libdiff_la_LDFLAGS = $(GITG_PLUGIN_LIBTOOL_FLAGS)
 
 libdiff_la_LIBADD = $(GITG_PLUGIN_LIBS)
-libdiff_la_CFLAGS = -w
+libdiff_la_VALAFLAGS = $(GITG_PLUGIN_VALAFLAGS)
 
 libdiff_la_SOURCES =                           \
        $(VALA_SOURCES)                         \
diff --git a/plugins/files/Makefile.am b/plugins/files/Makefile.am
index 8bae811..32be1d1 100644
--- a/plugins/files/Makefile.am
+++ b/plugins/files/Makefile.am
@@ -1,8 +1,6 @@
-AM_CPPFLAGS =                                                          \
+libfiles_la_CPPFLAGS =                                                 \
        -I$(top_srcdir)                                                 \
        -I$(srcdir)                                                     \
-       $(GITG_PLUGIN_CFLAGS)                                           \
-       $(WARN_CFLAGS)                                                  \
        -DDATADIR=\""$(datadir)"\"                                      \
        -DLIBDIR=\""$(libdir)"\"
 
@@ -10,15 +8,18 @@ plugindir = $(GITG_PLUGIN_LIBDIR)
 plugin_LTLIBRARIES = libfiles.la
 plugin_DATA = files.plugin
 
-AM_VALAFLAGS = $(GITG_PLUGIN_VALAFLAGS)
 VALA_SOURCES =                                                         \
        gitg-files.vala                                                 \
        gitg-files-tree-store.vala
+libfiles_la_CFLAGS =                                                   \
+       $(GITG_PLUGIN_CFLAGS)                                           \
+       $(WARN_CFLAGS)                                                  \
+       -w
 
 libfiles_la_LDFLAGS = $(GITG_PLUGIN_LIBTOOL_FLAGS)
-
 libfiles_la_LIBADD = $(GITG_PLUGIN_LIBS)
-libfiles_la_CFLAGS = -w
+libfiles_la_VALAFLAGS = $(GITG_PLUGIN_VALAFLAGS)
+
 
 libfiles_la_SOURCES =                          \
        $(VALA_SOURCES)                         \
diff --git a/tests/Makefile.am b/tests/Makefile.am
index f63e142..6e7ad12 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,23 +1,35 @@
-AM_CPPFLAGS = -g -I$(top_srcdir) -I$(top_srcdir)/gitg -I$(top_srcdir)/libgitg $(GITG_DEBUG_FLAGS) 
$(GITG_CFLAGS)
 SUBDIRS = libgitg
 
 noinst_PROGRAMS = $(TEST_PROGS) $(DEMO_PROGS)
+tests_common_cppflags =                        \
+       -I$(top_srcdir)                 \
+       -I$(top_srcdir)/gitg            \
+       -I$(top_srcdir)/libgitg
+
+tests_common_cflags =                  \
+       -g                              \
+       $(GITG_DEBUG_FLAGS)             \
+       $(GITG_CFLAGS)                  \
+       -w
+
+tests_common_valaflags = $(GITG_PLUGIN_VALAFLAGS)
 
-AM_VALAFLAGS = $(GITG_PLUGIN_VALAFLAGS)
 
 DEMO_PROGS = diff-view repository-list-box progress-bin
 
 diff_view_SOURCES = diff-view.vala
+diff_view_VALAFLAGS = $(tests_common_valaflags)
 diff_view_LDADD = $(GITG_PLUGIN_LIBS)
-diff_view_CFLAGS = $(GITG_PLUGIN_CFLAGS) -w
+diff_view_CFLAGS = $(tests_common_cflags)
+diff_view_CPPFLAGS = $(tests_common_cppflags)
 
 repository_list_box_SOURCES = repository-list-box.vala
 repository_list_box_LDADD = $(GITG_PLUGIN_LIBS)
-repository_list_box_CFLAGS = $(GITG_PLUGIN_CFLAGS) -w
+repository_list_box_CFLAGS = $(tests_common_cflags)
+repository_list_box_CPPFLAGS = $(tests_common_cppflags)
 
 progress_bin_SOURCES = progress-bin.vala
 progress_bin_LDADD = $(GITG_PLUGIN_LIBS)
-progress_bin_CFLAGS = $(GITG_PLUGIN_CFLAGS) -w
 
 TESTS = $(TEST_PROGS)
 
@@ -31,6 +43,8 @@ CLEANFILES =                                  \
        $(repository_list_box_SOURCES:.vala=.c)         \
        $(progress_bin_SOURCES:.vala=.c)        \
        $(BUILT_SOURCES)
+progress_bin_CFLAGS = $(tests_common_cflags)
+progress_bin_CPPFLAGS = $(tests_common_cppflags)
 
 -include $(top_srcdir)/git.mk
 


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