[Xfce4-commits] [apps/xfdashboard] 01/01: Prepare build system for other tools to reuse compiled object files, e.g. gtkdoc

noreply at xfce.org noreply at xfce.org
Thu Aug 6 22:16:51 CEST 2015


This is an automated email from the git hooks/post-receive script.

nomad pushed a commit to branch master
in repository apps/xfdashboard.

commit c2c296266853b67e2751f245b79a1b5c7e1f1b87
Author: Stephan Haller <nomad at froevel.de>
Date:   Thu Aug 6 22:14:36 2015 +0200

    Prepare build system for other tools to reuse compiled object files, e.g. gtkdoc
    
    Build a static library for all files except the main file containing function main() to reuse the compiled object files in other tools like gtkdoc. The final executable binary 'xfdashboard' is created by compiling main file containing function main() and link it against the static library and all other needed shared libraries (as it was done before)
---
 xfdashboard/Makefile.am |   44 ++++++++++++++++++++++++++++----------------
 1 file changed, 28 insertions(+), 16 deletions(-)

diff --git a/xfdashboard/Makefile.am b/xfdashboard/Makefile.am
index f664eb7..10afef5 100644
--- a/xfdashboard/Makefile.am
+++ b/xfdashboard/Makefile.am
@@ -5,6 +5,9 @@ AM_CPPFLAGS = \
 	-DPACKAGE_LOCALE_DIR=\"$(localedir)\" \
 	$(PLATFORM_CPPFLAGS)
 
+noinst_LTLIBRARIES = \
+	libxfdashboard.la
+
 bin_PROGRAMS = \
 	xfdashboard
 
@@ -77,7 +80,7 @@ xfdashboard_headers = \
 	windows-view.h \
 	workspace-selector.h
 
-xfdashboard_SOURCES = \
+libxfdashboard_la_SOURCES = \
 	$(xfdashboard_built_sources) \
 	$(xfdashboard_headers) \
 	actor.c \
@@ -107,7 +110,6 @@ xfdashboard_SOURCES = \
 	image-content.c \
 	live-window.c \
 	live-workspace.c \
-	main.c \
 	outline-effect.c \
 	quicklaunch.c \
 	scaled-table-layout.c \
@@ -140,7 +142,7 @@ xfdashboard_SOURCES = \
 	windows-view.c \
 	workspace-selector.c
 
-xfdashboard_CFLAGS = \
+libxfdashboard_la_CFLAGS = \
 	$(LIBWNCK_CFLAGS) \
 	$(CLUTTER_CFLAGS) \
 	$(CLUTTER_COGL_CFLAGS) \
@@ -153,12 +155,7 @@ xfdashboard_CFLAGS = \
 	$(DBUS_GLIB_CFLAGS) \
 	$(PLATFORM_CFLAGS)
 
-xfdashboard_LDFLAGS = \
-	-export-dynamic \
-	-no-undefined \
-	$(PLATFORM_LDFLAGS)
-
-xfdashboard_LDADD = \
+libxfdashboard_la_LIBADD = \
 	$(LIBWNCK_LIBS) \
 	$(CLUTTER_LIBS) \
 	$(CLUTTER_COGL_LIBS) \
@@ -169,32 +166,47 @@ xfdashboard_LDADD = \
 	$(LIBXFCONF_LIBS) \
 	$(LIBXFCE4UTIL_LIBS) \
 	$(DBUS_GLIB_LIBS) \
-	-lm
+	$(LIBM)
 
 if XFDASHBOARD_BUILD_WITH_XCOMPOSITE
-xfdashboard_CFLAGS += \
+libxfdashboard_la_CFLAGS += \
 	$(XCOMPOSITE_CFLAGS)
 
-xfdashboard_LDADD += \
+libxfdashboard_la_LIBADD += \
 	$(XCOMPOSITE_LIBS)
 endif
 
 if XFDASHBOARD_BUILD_WITH_XDAMAGE
-xfdashboard_CFLAGS += \
+libxfdashboard_la_CFLAGS += \
 	$(XDAMAGE_CFLAGS)
 
-xfdashboard_LDADD += \
+libxfdashboard_la_LIBADD += \
 	$(XDAMAGE_LIBS)
 endif
 
 if XFDASHBOARD_BUILD_WITH_XINERAMA
-xfdashboard_CFLAGS += \
+libxfdashboard_la_CFLAGS += \
 	$(XINERAMA_CFLAGS)
 
-xfdashboard_LDADD += \
+libxfdashboard_la_LIBADD += \
 	$(XINERAMA_LIBS)
 endif
 
+xfdashboard_SOURCES = \
+	main.c
+
+xfdashboard_CFLAGS = \
+	$(libxfdashboard_la_CFLAGS)
+
+xfdashboard_LDADD = \
+	libxfdashboard.la
+
+xfdashboard_LDFLAGS = \
+	$(PLATFORM_LDFLAGS) \
+	-export-dynamic \
+	-no-undefined \
+	-Wl,--whole-archive,.libs/libxfdashboard.a,--no-whole-archive
+
 if MAINTAINER_MODE
 
 CLEANFILES = \

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list