[Xfce4-commits] <xfce4-screenshooter:master> Use a non-recursive Makefile.am to build the sources.

Jérôme Guelfucci jeromeg at xfce.org
Fri Aug 14 00:26:02 CEST 2009


Updating branch refs/heads/master
         to eefbf7c8734838c16b809ad4774ad720cfef0391 (commit)
       from ccbfc4ac8f00e3f3e73bdbbe7708a723c740d554 (commit)

commit eefbf7c8734838c16b809ad4774ad720cfef0391
Author: Jérôme Guelfucci <jeromeg at xfce.org>
Date:   Fri Jul 31 18:31:03 2009 +0200

    Use a non-recursive Makefile.am to build the sources.
    
    The non-recursive Makefile.am is used to build the convenience library,
    the main application and the panel plugin. This reduces the build time
    and it is no longer necessary to clean the whole project before build
    to test changes in the convenience library.
    
    Recursive makefiles are still used for the translations, the
    documentation and the icons.

 ChangeLog                |   12 ++++
 Makefile.am              |  160 +++++++++++++++++++++++++++++++++++++++++++---
 configure.ac.in          |    2 -
 lib/Makefile.am          |   76 ----------------------
 panel-plugin/Makefile.am |   44 -------------
 src/Makefile.am          |   42 ------------
 6 files changed, 162 insertions(+), 174 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 89b8320..4389b55 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,18 @@ Fixed the Indonesian documentation sub-directory, the autotools scripts were
 incomplete.
 Updated Italian and Galician documentation translation.
 
+2009-07-31 jeromeg
+
+Use a non-recursive Makefile.am to build the sources.
+
+The non-recursive Makefile.am is used to build the convenience library,
+the main application and the panel plugin. This reduces the build time
+and it is no longer necessary to clean the whole project before build
+to test changes in the convenience library.
+
+Recursive make files are still used for the translations, the 
+documentation and the icons.
+
 2009-07-30 jeromeg
 
 Fix all warnings when running the autogen script.
diff --git a/Makefile.am b/Makefile.am
index d31b0d7..0169a90 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,10 @@
 @SET_MAKE@
 
-SUBDIRS = lib src panel-plugin po po-doc icons docs
+AUTOMAKE_OPTIONS = subdir-objects
+
+SUBDIRS = po po-doc icons docs
+
+bin_PROGRAMS = src/xfce4-screenshooter
 
 distclean-local:
 	rm -rf *.cache *~
@@ -11,16 +15,152 @@ dist-bz2: dist
 distcheck-bz2: distcheck
 	zcat $(PACKAGE)-$(VERSION).tar.gz | bzip2 --best -c > $(PACKAGE)-$(VERSION).tar.bz2
 
-EXTRA_DIST = 								\
-	README								\
-	intltool-extract.in						\
-	intltool-merge.in						\
-	intltool-update.in
+# Convienence library for the application and the panel plugin
+noinst_LTLIBRARIES = lib/libscreenshooter.la
+
+lib_libscreenshooter_la_SOURCES =	\
+	$(lib_libscreenshooter_built_sources) \
+  lib/exo-job.c lib/exo-job.h \
+	lib/exo-simple-job.c lib/exo-simple-job.h \
+	lib/katze-throbber.c lib/katze-throbber.h \
+	lib/libscreenshooter.h \
+  lib/sexy-url-label.c lib/sexy-url-label.h \
+	lib/screenshooter-actions.c lib/screenshooter-actions.h \
+	lib/screenshooter-capture.c lib/screenshooter-capture.h \
+  lib/screenshooter-dialogs.c lib/screenshooter-dialogs.h \
+	lib/screenshooter-global.h \
+	lib/screenshooter-job.c lib/screenshooter-job.h \
+	lib/screenshooter-simple-job.c lib/screenshooter-simple-job.h \
+	lib/screenshooter-utils.c lib/screenshooter-utils.h \
+	lib/screenshooter-zimagez.c lib/screenshooter-zimagez.h
+
+lib_libscreenshooter_la_CFLAGS = \
+	-I$(top_srcdir)	\
+  @GTK_CFLAGS@ \
+	@GLIB_CFLAGS@ \
+	@LIBXFCE4UTIL_CFLAGS@ \
+	@LIBXFCEGUI4_CFLAGS@ \
+	@SOUP_CFLAGS@ \
+  -DPACKAGE_LOCALE_DIR=\"$(localedir)\"
+
+lib_libscreenshooter_la_LIBADD = \
+  @GTK_LIBS@ \
+	@LIBXFCE4UTIL_LIBS@ \
+	@LIBXFCEGUI4_LIBS@ \
+  @GLIB_LIBS@ \
+	@SOUP_LIBS@
+
+lib_libscreenshooter_built_sources = \
+	lib/screenshooter-marshal.c lib/screenshooter-marshal.h
+
+#Autogenerated sources for the library
+BUILT_SOURCES =	$(lib_libscreenshooter_built_sources)
+
+lib/screenshooter-marshal.h: lib/stamp-screenshooter-marshal.h
+	@true
+lib/stamp-screenshooter-marshal.h: lib/screenshooter-marshal.list
+	( cd $(top_srcdir)/lib && glib-genmarshal \
+		--prefix=_screenshooter_marshal \
+		--header screenshooter-marshal.list ) >> xgen-emh \
+	&& ( cmp -s xgen-emh screenshooter-marshal.h || cp xgen-emh screenshooter-marshal.h ) \
+	&& rm -f xgen-emh \
+	&& echo timestamp > $(@F)
+
+lib/screenshooter-marshal.c: lib/screenshooter-marshal.list
+	cd $(top_srcdir)/lib \
+	&& echo "#include \"screenshooter-marshal.h\"" > xgen-emc \
+	&& glib-genmarshal \
+	--prefix=_screenshooter_marshal \
+	--body screenshooter-marshal.list >> xgen-emc \
+	&& cp xgen-emc screenshooter-marshal.c \
+	&& rm -f xgen-emc
+
+# Main application
+src_xfce4_screenshooter_CFLAGS = \
+	-I$(top_srcdir)/lib \
+	@GTK_CFLAGS@ \
+	@GLIB_CFLAGS@ \
+	@LIBXFCE4UTIL_CFLAGS@ \
+	@LIBXFCEGUI4_CFLAGS@ \
+	@GTHREAD_CFLAGS@ \
+	@SOUP_CFLAGS@ \
+	-DPACKAGE_LOCALE_DIR=\"$(localedir)\"
+	
+src_xfce4_screenshooter_LDFLAGS = \
+	$(top_builddir)/lib/libscreenshooter.la \
+	@GTK_LIBS@ \
+	@GLIB_LIBS@ \
+	@GTHREAD_LIBS@ \
+	@SOUP_LIBS@ \
+	@LIBXFCE4UTIL_LIBS@ \
+	@LIBXFCEGUI4_LIBS@
+	
+src_xfce4_screenshooter_SOURCES	= \
+	src/main.c
+
+# Desktop file for the application
+app_desktopdir = $(datadir)/applications
+app_desktop_in_in_files = src/xfce4-screenshooter.desktop.in.in
+app_desktop_in_files = $(app_desktop_in_in_files:.desktop.in.in=.desktop.in)
+app_desktop_DATA = $(app_desktop_in_files:.desktop.in=.desktop)
+ at INTLTOOL_DESKTOP_RULE@
+
+src/xfce4-screenshooter.desktop.in: src/xfce4-screenshooter.desktop.in.in
+	sed -e "s^@PLUGIN_PATH@^$(libexecdir)/applications^" 	\
+		$< > $@
+
+# Panel plugin
+plugindir = $(libexecdir)/xfce4/panel-plugins
+plugin_PROGRAMS = panel-plugin/xfce4-screenshooter-plugin
+
+panel_plugin_xfce4_screenshooter_plugin_CFLAGS =	\
+	-DPACKAGE_LOCALE_DIR=\"$(localedir)\"	\
+	-I$(top_srcdir)	\
+	-I$(top_srcdir)/lib	\
+	@LIBXFCE4PANEL_CFLAGS@ \
+	@GTHREAD_CFLAGS@ \
+	@SOUP_CFLAGS@
+
+panel_plugin_xfce4_screenshooter_plugin_LDFLAGS = \
+	$(top_builddir)/lib/libscreenshooter.la \
+	@LIBXFCE4PANEL_LIBS@ \
+	@GTHREAD_LIBS@ \
+	@SOUP_LIBS@
+
+panel_plugin_xfce4_screenshooter_plugin_SOURCES = \
+	panel-plugin/screenshooter-plugin.c
+
+# Panel plugin desktop file
+panel_desktop_in_in_files = panel-plugin/screenshooter.desktop.in.in
+panel_desktop_in_files = $(desktop_in_in_files:.desktop.in.in=.desktop.in)
+
+panel_desktopdir = $(datadir)/xfce4/panel-plugins
+panel_desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
+ at INTLTOOL_DESKTOP_RULE@
+
+panel-plugin/screenshooter.desktop.in: panel-plugin/screenshooter.desktop.in.in
+	sed -e "s^@PLUGIN_PATH@^$(libexecdir)/xfce4/panel-plugins^" 	\
+		$< > $@
+
+# Extra dist and distclean rules
+EXTRA_DIST = \
+	README	\
+	intltool-extract.in	\
+	intltool-merge.in	\
+	intltool-update.in \
+	lib/screenshooter-marshal.list \
+	$(app_desktop_in_in_files) \
+	$(panel_desktop_in_in_files)
 
-DISTCLEANFILES =							\
-	intltool-extract						\
-	intltool-merge							\
-	intltool-update
+DISTCLEANFILES = \
+	intltool-extract \
+	intltool-merge \
+	intltool-update \
+	stamp-screenshooter-marshal.h \
+	$(lib_libscreenshooter_built_sources) \
+	$(app_desktop_DATA) $(app_desktop_in_files) \
+	$(panel_desktop_DATA) $(panel_desktop_in_files)
 
+# Man pages
 dist_man_MANS = xfce4-screenshooter.1
 
diff --git a/configure.ac.in b/configure.ac.in
index 83e4366..4889fc7 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -119,8 +119,6 @@ docs/manual/tr/images/Makefile
 icons/Makefile
 icons/48x48/Makefile
 icons/scalable/Makefile
-lib/Makefile
-src/Makefile
 panel-plugin/Makefile
 po/Makefile.in
 po-doc/Makefile
diff --git a/lib/Makefile.am b/lib/Makefile.am
deleted file mode 100644
index c559eea..0000000
--- a/lib/Makefile.am
+++ /dev/null
@@ -1,76 +0,0 @@
-noinst_LTLIBRARIES = \
-	libscreenshooter.la
-
-libscreenshooter_la_SOURCES =	\
-	$(libscreenshooter_built_sources) \
-  exo-job.c exo-job.h \
-	exo-simple-job.c exo-simple-job.h \
-	katze-throbber.c katze-throbber.h \
-	libscreenshooter.h \
-  sexy-url-label.c sexy-url-label.h \
-	screenshooter-actions.c screenshooter-actions.h \
-	screenshooter-capture.c screenshooter-capture.h \
-  screenshooter-dialogs.c screenshooter-dialogs.h \
-	screenshooter-global.h \
-	screenshooter-job.c screenshooter-job.h \
-	screenshooter-simple-job.c screenshooter-simple-job.h \
-	screenshooter-utils.c screenshooter-utils.h \
-	screenshooter-zimagez.c screenshooter-zimagez.h
-
-libscreenshooter_la_CFLAGS = \
-	-I$(top_srcdir)	\
-  @GTK_CFLAGS@ \
-	@GLIB_CFLAGS@ \
-	@LIBXFCE4UTIL_CFLAGS@ \
-	@LIBXFCEGUI4_CFLAGS@ \
-	@SOUP_CFLAGS@ \
-  -DPACKAGE_LOCALE_DIR=\"$(localedir)\"
-	
-libscreenshooter_la_LIBADD = \
-  @GTK_LIBS@ \
-	@LIBXFCE4UTIL_LIBS@ \
-	@LIBXFCEGUI4_LIBS@ \
-  @GLIB_LIBS@ \
-	@SOUP_LIBS@
-
-libscreenshooter_built_sources = \
-	screenshooter-marshal.c screenshooter-marshal.h
-
-##
-## Rules to auto-generate built sources
-##
-## This is a bit tricky with automake, and non-trivial to implement. The
-## rules below seem to work fine and don't seem to break the build, but
-## they are only enabled in maintainer mode, so arbitrary users don't get
-## trapped in automake's oddities. Therefore we ship the autogenerated
-## files as part of the dist tarball.
-##
-
-DISTCLEANFILES =	\
-	stamp-screenshooter-marshal.h \
-	$(libscreenshooter_built_sources)
-
-BUILT_SOURCES = \
-	$(libscreenshooter_built_sources)
-
-screenshooter-marshal.h: stamp-screenshooter-marshal.h
-	@true
-stamp-screenshooter-marshal.h: screenshooter-marshal.list Makefile
-	( cd $(srcdir) && glib-genmarshal \
-		--prefix=_screenshooter_marshal \
-		--header screenshooter-marshal.list ) >> xgen-emh \
-	&& ( cmp -s xgen-emh screenshooter-marshal.h || cp xgen-emh screenshooter-marshal.h ) \
-	&& rm -f xgen-emh \
-	&& echo timestamp > $(@F)
-
-screenshooter-marshal.c: screenshooter-marshal.list Makefile
-	cd $(srcdir) \
-	&& echo "#include \"screenshooter-marshal.h\"" > xgen-emc \
-	&& glib-genmarshal \
-	--prefix=_screenshooter_marshal \
-	--body screenshooter-marshal.list >> xgen-emc \
-	&& cp xgen-emc screenshooter-marshal.c \
-	&& rm -f xgen-emc
-
-EXTRA_DIST = \
-	screenshooter-marshal.list
diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
deleted file mode 100644
index 6c15555..0000000
--- a/panel-plugin/Makefile.am
+++ /dev/null
@@ -1,44 +0,0 @@
-plugindir = $(libexecdir)/xfce4/panel-plugins
-plugin_PROGRAMS = xfce4-screenshooter-plugin
-
-xfce4_screenshooter_plugin_CFLAGS =	\
-	-DPACKAGE_LOCALE_DIR=\"$(localedir)\"	\
-	-I$(top_srcdir)	\
-	-I$(top_srcdir)/lib	\
-	@LIBXFCE4PANEL_CFLAGS@ \
-	@GTHREAD_CFLAGS@ \
-	@SOUP_CFLAGS@
-
-xfce4_screenshooter_plugin_LDFLAGS = \
-	$(top_builddir)/lib/libscreenshooter.la \
-	@LIBXFCE4PANEL_LIBS@ \
-	@GTHREAD_LIBS@ \
-	@SOUP_LIBS@
-
-xfce4_screenshooter_plugin_SOURCES = \
-	screenshooter-plugin.c
-	
-# .desktop file
-#
-# Some automake trickery here. Because we cannot use $(libexecdir) in the
-# automake stage, we'll use sed to get the full path into the .desktop file.
-# We also need to let intltool merge the translated fields, so we add an
-# additional level of indirection: a <name>.desktop.in.in file.
-#
-desktop_in_in_files = screenshooter.desktop.in.in
-desktop_in_files = $(desktop_in_in_files:.desktop.in.in=.desktop.in)
-
-desktopdir = $(datadir)/xfce4/panel-plugins
-desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
- at INTLTOOL_DESKTOP_RULE@
-
-# get full path into .desktop file
-screenshooter.desktop.in: screenshooter.desktop.in.in
-	sed -e "s^@PLUGIN_PATH@^$(libexecdir)/xfce4/panel-plugins^" 	\
-		$< > $@
-
-EXTRA_DIST =								\
-	$(desktop_in_in_files)
-
-DISTCLEANFILES =							\
-	$(desktop_DATA) $(desktop_in_files)
diff --git a/src/Makefile.am b/src/Makefile.am
deleted file mode 100644
index c9a26d8..0000000
--- a/src/Makefile.am
+++ /dev/null
@@ -1,42 +0,0 @@
-bin_PROGRAMS = xfce4-screenshooter
-	
-xfce4_screenshooter_CFLAGS = \
-	-I$(top_srcdir)/lib \
-	@GTK_CFLAGS@ \
-	@GLIB_CFLAGS@ \
-	@LIBXFCE4UTIL_CFLAGS@ \
-	@LIBXFCEGUI4_CFLAGS@ \
-	@GTHREAD_CFLAGS@ \
-	@SOUP_CFLAGS@ \
-	-DPACKAGE_LOCALE_DIR=\"$(localedir)\"
-	
-xfce4_screenshooter_LDFLAGS = \
-	$(top_builddir)/lib/libscreenshooter.la \
-	@GTK_LIBS@ \
-	@GLIB_LIBS@ \
-	@GTHREAD_LIBS@ \
-	@SOUP_LIBS@ \
-	@LIBXFCE4UTIL_LIBS@ \
-	@LIBXFCEGUI4_LIBS@
-
-	
-xfce4_screenshooter_SOURCES	= \
-	main.c		
-
-desktopdir = $(datadir)/applications
-desktop_in_in_files = xfce4-screenshooter.desktop.in.in
-desktop_in_files = $(desktop_in_in_files:.desktop.in.in=.desktop.in)
-desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
- at INTLTOOL_DESKTOP_RULE@
-
-# get full path into .desktop file
-xfce4-screenshooter.desktop.in: xfce4-screenshooter.desktop.in.in
-	sed -e "s^@PLUGIN_PATH@^$(libexecdir)/applications^" 	\
-		$< > $@
-	
-EXTRA_DIST =								\
-	$(desktop_in_in_files)
-
-DISTCLEANFILES =							\
-	$(desktop_DATA) $(desktop_in_files)
-



More information about the Xfce4-commits mailing list