build: Add AM_* variables to all per-target special variables

For example, add $(AM_CFLAGS) to mumble_CFLAGS. Since $(WARN_CFLAGS) is
only added to $(AM_CFLAGS), this fixes the lack of inclusion of the
compiler warning flags in the compilation of half of flatpak.

Note that $(AM_*) variables are only used by automake if a more specific
(per-target) special variable is not defined instead. So if you define
mumble_CFLAGS, AM_CFLAGS will not be used for that target unless
explicitly included in mumble_CFLAGS.

See
https://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html.

Do the same for $(AM_LIBADD), $(AM_LDFLAGS), etc. These are not
currently defined, but it’s good practice to include them in
mumble_LIBADD (etc.) just in case they’re defined in future. Hopefully
their inclusions will be cargo-culted to any new targets which are
added, retaining full coverage of the code base.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
tingping/wmclass
Philip Withnall 2017-07-06 14:34:13 +01:00
parent 95c3c942d3
commit f47a696392
10 changed files with 25 additions and 18 deletions

View File

@ -100,8 +100,8 @@ if !WITH_SYSTEM_BWRAP
bwrap_PROGRAMS = flatpak-bwrap
flatpak_bwrap_SOURCES = $(bwrap_SOURCES)
flatpak_bwrap_CFLAGS = $(bwrap_CFLAGS)
flatpak_bwrap_LDADD = $(bwrap_LDADD)
flatpak_bwrap_CFLAGS = $(AM_CFLAGS) $(bwrap_CFLAGS)
flatpak_bwrap_LDADD = $(AM_LDADD) $(bwrap_LDADD)
bwrapdir = $(libexecdir)
include bubblewrap/Makefile-bwrap.am.inc

View File

@ -38,6 +38,6 @@ flatpak_SOURCES = \
app/flatpak-builtins-document-list.c \
$(NULL)
flatpak_LDADD = $(BASE_LIBS) $(OSTREE_LIBS) $(SOUP_LIBS) $(JSON_LIBS) libglnx.la libflatpak-common.la
flatpak_CFLAGS = $(BASE_CFLAGS) $(OSTREE_CFLAGS) $(SOUP_CFLAGS) $(JSON_CFLAGS) \
flatpak_LDADD = $(AM_LDADD) $(BASE_LIBS) $(OSTREE_LIBS) $(SOUP_LIBS) $(JSON_LIBS) libglnx.la libflatpak-common.la
flatpak_CFLAGS = $(AM_CFLAGS) $(BASE_CFLAGS) $(OSTREE_CFLAGS) $(SOUP_CFLAGS) $(JSON_CFLAGS) \
-DLOCALEDIR=\"$(localedir)\"

View File

@ -38,6 +38,6 @@ flatpak_builder_SOURCES = \
builder/builder-git.h \
$(NULL)
flatpak_builder_LDADD = $(BASE_LIBS) $(OSTREE_LIBS) $(JSON_LIBS) $(SOUP_LIBS) $(LIBELF_LIBS) \
flatpak_builder_LDADD = $(AM_LDADD) $(BASE_LIBS) $(OSTREE_LIBS) $(JSON_LIBS) $(SOUP_LIBS) $(LIBELF_LIBS) \
libglnx.la libflatpak-common.la
flatpak_builder_CFLAGS = $(BASE_CFLAGS) $(OSTREE_CFLAGS) $(JSON_CFLAGS) $(SOUP_CFLAGS)
flatpak_builder_CFLAGS = $(AM_CFLAGS) $(BASE_CFLAGS) $(OSTREE_CFLAGS) $(JSON_CFLAGS) $(SOUP_CFLAGS)

View File

@ -74,4 +74,4 @@ libflatpak_common_la_CFLAGS = \
$(INTERNAL_GPGME_CFLAGS) \
-I$(srcdir)/dbus-proxy \
$(NULL)
libflatpak_common_la_LIBADD = libglnx.la $(BASE_LIBS) $(OSTREE_LIBS) $(SOUP_LIBS) $(JSON_LIBS) $(XAUTH_LIBS) $(LIBSECCOMP_LIBS) $(INTERNAL_GPGME_LIBS)
libflatpak_common_la_LIBADD = $(AM_LIBADD) libglnx.la $(BASE_LIBS) $(OSTREE_LIBS) $(SOUP_LIBS) $(JSON_LIBS) $(XAUTH_LIBS) $(LIBSECCOMP_LIBS) $(INTERNAL_GPGME_LIBS)

View File

@ -8,5 +8,5 @@ flatpak_dbus_proxy_SOURCES = \
dbus-proxy/dbus-proxy.c \
$(NULL)
flatpak_dbus_proxy_LDADD = $(BASE_LIBS) libglnx.la
flatpak_dbus_proxy_CFLAGS = $(BASE_CFLAGS) -I$(srcdir)/dbus-proxy
flatpak_dbus_proxy_LDADD = $(AM_LDADD) $(BASE_LIBS) libglnx.la
flatpak_dbus_proxy_CFLAGS = $(AM_CFLAGS) $(BASE_CFLAGS) -I$(srcdir)/dbus-proxy

View File

@ -39,5 +39,5 @@ xdg_document_portal_SOURCES = \
document-portal/xdp-fuse.c \
$(NULL)
xdg_document_portal_LDADD = $(BASE_LIBS) $(FUSE_LIBS) libflatpak-common.la
xdg_document_portal_CFLAGS = $(BASE_CFLAGS) $(OSTREE_CFLAGS) $(SOUP_CFLAGS) $(JSON_CFLAGS) $(FUSE_CFLAGS) -I$(srcdir)/document-portal -I$(builddir)/document-portal -I$(srcdir)/permission-store -I$(builddir)/permission-store -DFLATPAK_COMPILATION
xdg_document_portal_LDADD = $(AM_LDADD) $(BASE_LIBS) $(FUSE_LIBS) libflatpak-common.la
xdg_document_portal_CFLAGS = $(AM_CFLAGS) $(BASE_CFLAGS) $(OSTREE_CFLAGS) $(SOUP_CFLAGS) $(JSON_CFLAGS) $(FUSE_CFLAGS) -I$(srcdir)/document-portal -I$(builddir)/document-portal -I$(srcdir)/permission-store -I$(builddir)/permission-store -DFLATPAK_COMPILATION

View File

@ -79,12 +79,14 @@ libflatpak_la_CFLAGS = \
$(NULL)
libflatpak_la_LDFLAGS = \
$(AM_LDFLAGS) \
-version-info $(LT_VERSION_INFO) \
-export-dynamic \
-rpath $(libdir) \
$(NULL)
libflatpak_la_LIBADD = \
$(AM_LIBADD) \
libflatpak-common.la \
$(BASE_LIBS) \
$(OSTREE_LIBS) \
@ -97,12 +99,14 @@ test_libflatpak_SOURCES = \
$(NULL)
test_libflatpak_CFLAGS = \
$(AM_CFLAGS) \
$(BASE_CFLAGS) \
-I$(top_srcdir)/lib \
-I$(top_builddir)/lib \
$(NULL)
test_libflatpak_LDADD = \
$(AM_LDADD) \
$(BASE_LIBS) \
libflatpak.la \
$(NULL)

View File

@ -33,5 +33,5 @@ xdg_permission_store_SOURCES = \
permission-store/xdg-permission-store.h \
$(NULL)
xdg_permission_store_LDADD = $(BASE_LIBS) libflatpak-common.la
xdg_permission_store_CFLAGS = $(BASE_CFLAGS) $(SOUP_CFLAGS) $(JSON_CFLAGS) $(OSTREE_CFLAGS) $(GSYSTEM_CFLAGS) -I$(srcdir)/permission-store -I$(builddir)/permission-store
xdg_permission_store_LDADD = $(AM_LDADD) $(BASE_LIBS) libflatpak-common.la
xdg_permission_store_CFLAGS = $(AM_CFLAGS) $(BASE_CFLAGS) $(SOUP_CFLAGS) $(JSON_CFLAGS) $(OSTREE_CFLAGS) $(GSYSTEM_CFLAGS) -I$(srcdir)/permission-store -I$(builddir)/permission-store

View File

@ -12,5 +12,5 @@ flatpak_session_helper_SOURCES = \
session-helper/flatpak-session-helper.c \
$(NULL)
flatpak_session_helper_LDADD = $(BASE_LIBS) libflatpak-common.la
flatpak_session_helper_CFLAGS = $(BASE_CFLAGS) $(SOUP_CFLAGS) $(OSTREE_CFLAGS) $(GSYSTEM_CFLAGS) $(JSON_CFLAGS)
flatpak_session_helper_LDADD = $(AM_LDADD) $(BASE_LIBS) libflatpak-common.la
flatpak_session_helper_CFLAGS = $(AM_CFLAGS) $(BASE_CFLAGS) $(SOUP_CFLAGS) $(OSTREE_CFLAGS) $(GSYSTEM_CFLAGS) $(JSON_CFLAGS)

View File

@ -12,8 +12,9 @@ else
TESTS_ENVIRONMENT += FLATPAK_BWRAP=$$(cd $(top_builddir) && pwd)/flatpak-bwrap
endif
testdb_CFLAGS = $(BASE_CFLAGS)
testdb_CFLAGS = $(AM_CFLAGS) $(BASE_CFLAGS)
testdb_LDADD = \
$(AM_LDADD) \
$(BASE_LIBS) \
$(OSTREE_LIBS) \
libglnx.la \
@ -21,8 +22,9 @@ testdb_LDADD = \
$(NULL)
testdb_SOURCES = tests/testdb.c
test_doc_portal_CFLAGS = $(BASE_CFLAGS)
test_doc_portal_CFLAGS = $(AM_CFLAGS) $(BASE_CFLAGS)
test_doc_portal_LDADD = \
$(AM_LDADD) \
$(BASE_LIBS) \
$(OSTREE_LIBS) \
libglnx.la \
@ -31,8 +33,9 @@ test_doc_portal_LDADD = \
test_doc_portal_SOURCES = tests/test-doc-portal.c
nodist_test_doc_portal_SOURCES = $(xdp_dbus_built_sources)
testlibrary_CFLAGS = $(BASE_CFLAGS)
testlibrary_CFLAGS = $(AM_CFLAGS) $(BASE_CFLAGS)
testlibrary_LDADD = \
$(AM_LDADD) \
$(BASE_LIBS) \
libglnx.la \
libflatpak.la \