From ef7bc8fd84e434e985459215624ce1798e92401b Mon Sep 17 00:00:00 2001 From: Jonathan Maw Date: Thu, 28 Jun 2012 09:54:01 +0100 Subject: [PATCH] Add convenience library 'libcommon.la' Reference to individual components of the 'common' directory in components' respective makefiles are replaced with reference to the convenience library 'libcommon.la' --- Makefile.am | 1 + boot-manager/Makefile.am | 12 +++++++----- common/Makefile.am | 30 ++++++++++++++++++++++++++++++ configure.ac | 1 + legacy-app-handler/Makefile.am | 8 +++++--- luc-handler/Makefile.am | 10 +++++----- 6 files changed, 49 insertions(+), 13 deletions(-) create mode 100644 common/Makefile.am diff --git a/Makefile.am b/Makefile.am index 95c7abb..bf8f9dc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,7 @@ # vi:set ts=8 sw=8 noet ai nocindent: SUBDIRS = \ + common \ luc-handler \ boot-manager \ legacy-app-handler \ diff --git a/boot-manager/Makefile.am b/boot-manager/Makefile.am index 4722350..a6f635b 100644 --- a/boot-manager/Makefile.am +++ b/boot-manager/Makefile.am @@ -16,10 +16,8 @@ boot_manager_built_sources = \ $(boot_manager_built_headers) boot_manager_SOURCES = \ - ../common/watchdog-client.c \ - ../common/watchdog-client.h \ - ../luc-handler/luc-handler-dbus.c \ - ../luc-handler/luc-handler-dbus.h \ + $(top_srcdir)/luc-handler/luc-handler-dbus.c \ + $(top_srcdir)/luc-handler/luc-handler-dbus.h \ boot-manager-application.c \ boot-manager-application.h \ boot-manager-service.c \ @@ -46,12 +44,16 @@ boot_manager_LDFLAGS = \ -no-undefined \ $(PLATFORM_LDFLAGS) +boot_manager_DEPENDENCIES = \ + $(top_builddir)/common/libcommon.la + boot_manager_LDADD = \ $(DLT_LIBS) \ $(GIO_LIBS) \ $(GIO_UNIX_LIBS) \ $(GLIB_LIBS) \ - $(SYSTEMD_DAEMON_LIBS) + $(SYSTEMD_DAEMON_LIBS) \ + $(top_builddir)/common/libcommon.la servicedir = $(datadir)/dbus-1/services service_in_files = \ diff --git a/common/Makefile.am b/common/Makefile.am new file mode 100644 index 0000000..4608d52 --- /dev/null +++ b/common/Makefile.am @@ -0,0 +1,30 @@ +# vi:set ts=8 sw=8 noet ai nocindent: + +noinst_LTLIBRARIES = libcommon.la + +libcommon_la_SOURCES = \ + glib-extensions.c \ + glib-extensions.h \ + watchdog-client.c \ + watchdog-client.h + +libcommon_la_CFLAGS = \ + -DG_LOG_DOMAIN=\"common\" \ + -I$(top_srcdir) \ + $(GIO_CFLAGS) \ + $(GIO_UNIX_CFLAGS) \ + $(GLIB_CFLAGS) \ + $(PLATFORM_CFLAGS) \ + $(PLATFORM_CPPFLAGS) \ + $(SYSTEMD_DAEMON_CFLAGS) + +libcommon_la_LDFLAGS = \ + -no-undefined \ + $(PLATFORM_LDFLAGS) + +libcommon_la_LIBADD = \ + $(GIO_LIBS) \ + $(GIO_UNIX_LIBS) \ + $(GLIB_LIBS) \ + $(SYSTEMD_DAEMON_LIBS) + diff --git a/configure.ac b/configure.ac index 6fe52b5..6469053 100644 --- a/configure.ac +++ b/configure.ac @@ -135,6 +135,7 @@ AC_DEFINE_UNQUOTED([PRIORITISED_LUC_TYPES], AC_OUTPUT([ Makefile +common/Makefile boot-manager/Makefile legacy-app-handler/Makefile luc-handler/Makefile diff --git a/legacy-app-handler/Makefile.am b/legacy-app-handler/Makefile.am index 5627476..38c1b75 100644 --- a/legacy-app-handler/Makefile.am +++ b/legacy-app-handler/Makefile.am @@ -14,8 +14,6 @@ legacy_app_handler_built_sources = \ $(legacy_app_handler_built_headers) legacy_app_handler_SOURCES = \ - ../common/watchdog-client.c \ - ../common/watchdog-client.h \ la-handler-application.c \ la-handler-application.h \ la-handler-service.c \ @@ -38,12 +36,16 @@ legacy_app_handler_LDFLAGS = \ -no-undefined \ $(PLATFORM_LDFLAGS) +legacy_app_handler_DEPENDENCIES = \ + $(top_builddir)/common/libcommon.la + legacy_app_handler_LDADD = \ $(DLT_LIBS) \ $(GIO_LIBS) \ $(GIO_UNIX_LIBS) \ $(GLIB_LIBS) \ - $(SYSTEMD_DAEMON_LIBS) + $(SYSTEMD_DAEMON_LIBS) \ + $(top_builddir)/common/libcommon.la servicedir = $(datadir)/dbus-1/services service_in_files = \ diff --git a/luc-handler/Makefile.am b/luc-handler/Makefile.am index bf1ddde..e86f4b1 100644 --- a/luc-handler/Makefile.am +++ b/luc-handler/Makefile.am @@ -14,10 +14,6 @@ luc_handler_built_sources = \ $(luc_handler_built_headers) luc_handler_SOURCES = \ - ../common/glib-extensions.c \ - ../common/glib-extensions.h \ - ../common/watchdog-client.c \ - ../common/watchdog-client.h \ luc-handler-application.c \ luc-handler-application.h \ luc-handler-service.c \ @@ -40,12 +36,16 @@ luc_handler_LDFLAGS = \ -no-undefined \ $(PLATFORM_LDFLAGS) +luc_handler_DEPENDENCIES = \ + $(top_builddir)/common/libcommon.la + luc_handler_LDADD = \ $(DLT_LIBS) \ $(GIO_LIBS) \ $(GIO_UNIX_LIBS) \ $(GLIB_LIBS) \ - $(SYSTEMD_DAEMON_LIBS) + $(SYSTEMD_DAEMON_LIBS) \ + $(top_builddir)/common/libcommon.la servicedir = $(datadir)/dbus-1/services service_in_files = \ -- 2.7.4