[mm-common] Support Automake silent rules



commit 849e551ee4a41e5ee71aa6c1db2b631e1099ef58
Author: Daniel Elstner <daniel kitta gmail com>
Date:   Sat Sep 19 02:41:12 2009 +0200

    Support Automake silent rules
    
    * configure.ac: Call the AM_SILENT_RULES macro if it is defined.
    * Makefile.am: Prefix the commands of custom rules with $(AM_V_at)
    or $(AM_V_GEN) to quieten the command echoing in silent mode.
    * build/*.am: Likewise for the common build support files.
    * build/generate-binding.am (mm_v_gen): Define custom silent output
    for the gmmproc code generation rule.

 Makefile.am               |    7 ++++---
 build/dist-changelog.am   |    2 +-
 build/doc-reference.am    |   12 ++++++------
 build/generate-binding.am |   10 +++++++---
 configure.ac              |    1 +
 5 files changed, 19 insertions(+), 13 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index c2c7bf4..be57df6 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -128,11 +128,12 @@ endif
 
 # Download the libstdc++ tag file from the GCC website.
 doctags/libstdc++.tag:
-	$(if $(CURL),$(download_curl) '$(libstdcxx_tag_url)',$(if\
-	     $(WGET),$(download_wget) '$(libstdcxx_tag_url)',test -f $@))
+	$(AM_V_at)$(if\
+	$(CURL),$(download_curl) '$(libstdcxx_tag_url)',$(if\
+	$(WGET),$(download_wget) '$(libstdcxx_tag_url)',test -f $@))
 
 # Build the mm-common-prepare(1) manual page.
 util/mm-common-prepare.1: $(srcdir)/util/mm-common-prepare.1.in Makefile
-	$(subst_manpage) $(srcdir)/util/mm-common-prepare.1.in >$@
+	$(AM_V_GEN)$(subst_manpage) $(srcdir)/util/mm-common-prepare.1.in >$@
 
 include $(top_srcdir)/build/dist-changelog.am
diff --git a/build/dist-changelog.am b/build/dist-changelog.am
index ddfdb76..e98eda7 100644
--- a/build/dist-changelog.am
+++ b/build/dist-changelog.am
@@ -24,7 +24,7 @@ endif
 .PHONY: dist-changelog
 
 dist-changelog:
-	@if git --git-dir="$(top_srcdir)/.git" --work-tree="$(top_srcdir)" \
+	$(AM_V_at)if git --git-dir=$(top_srcdir)/.git --work-tree=$(top_srcdir) \
 		log --no-merges --date=short --pretty='tformat:%cd  %an  <%ae>%n%n%s%n%n%b' | \
 	 $(SED)	-e '/^[12]...-[01].-[0123].  [^<>]*  <[^<>]*>$$/,/^$$/ b' \
 		-e '/[^	 ]/,/^[	 ]*$$/! d' \
diff --git a/build/doc-reference.am b/build/doc-reference.am
index 33c50db..2a54cb0 100644
--- a/build/doc-reference.am
+++ b/build/doc-reference.am
@@ -155,7 +155,7 @@ uninstall-devhelp:
 
 # Regenerate the Doxygen configuration file automatically.
 reference/Doxyfile: $(srcdir)/reference/Doxyfile.in $(top_builddir)/config.status
-	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+	$(AM_V_GEN)cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
 
 # Make sure that the documentation will always have been generated before
 # executing the commands of a rule that depends on files in reference/html/.
@@ -164,14 +164,14 @@ reference/html/%: | $(doxytagfile)
 # Run Doxygen to build the reference documentation. The generated tag file
 # also functions as time stamp target for the documentation as a whole.
 $(doxytagfile): $(doc_dependencies) | reference/Doxyfile
-	-rm -f $@
-	-rm -fr reference/html
-	(echo '@INCLUDE =' reference/Doxyfile && echo 'INPUT =' $(doc_input)) | $(DOXYGEN) -
-	$(doc_postprocess) 'reference/html/*.html'
+	-$(AM_V_at)rm -f $@
+	-$(AM_V_at)rm -fr reference/html
+	$(AM_V_GEN)(echo '@INCLUDE =' reference/Doxyfile && echo 'INPUT =' $(doc_input)) | $(DOXYGEN) -
+	$(AM_V_at)$(doc_postprocess) 'reference/html/*.html'
 
 # Run XSL transformation to generate a Devhelp book from a Doxygen tag file.
 %.devhelp2: %.tag
-	$(XSLTPROC) $(dh_xsl_params) -o $@ $(tagfile_to_devhelp2) $<
+	$(AM_V_GEN)$(XSLTPROC) $(dh_xsl_params) -o $@ $(tagfile_to_devhelp2) $<
 
 .PHONY: install-htmlref uninstall-htmlref install-devhelp uninstall-devhelp
 
diff --git a/build/generate-binding.am b/build/generate-binding.am
index b2e71ef..68839c1 100644
--- a/build/generate-binding.am
+++ b/build/generate-binding.am
@@ -60,21 +60,25 @@ gmmproc_flags ?= -I $(codegen_m4_srcdir) --defs $(srcdir)
 # Automatically created output directories.
 binding_mkdirs = $(binding_stampdir) $(binding_outputdir)/private
 
+# Show names of generated files in silent rules output.
+mm_0_gen = @echo '  GEN    $(binding_outputdir)/{$*.cc,$*.h,private/$*_p.h}';
+mm_v_gen = $(if $(filter 0,$(or $(V),$(AM_DEFAULT_VERBOSITY))),$(mm_0_gen))
+
 # Declare the built sources main targets.
 all-local: $(binding_stampfiles) $(other_built_sources)
 
 # Create the output directories if they do not exist already.
 $(binding_mkdirs):
-	$(MKDIR_P) $@
+	$(AM_V_at)$(MKDIR_P) $@
 
 # Generate the wrap_init.cc file using generate_wrap_init.pl.
 $(binding_outputdir)/wrap_init.cc: $(binding_relfiles_hg) $(srcdir)/Makefile.in
-	$(gen_wrap_init) $(wrap_init_flags) $(binding_relfiles_hg) >$@
+	$(AM_V_GEN)$(gen_wrap_init) $(wrap_init_flags) $(binding_relfiles_hg) >$@
 
 # Run the gmmproc code generator to produce the C++ binding code.
 $(binding_stampdir)/%.stamp: %.hg %.ccg $(gmmproc_dependencies) | $(binding_mkdirs)
 	@: >$@
-	$(gmmproc) $(gmmproc_flags) $(notdir $*) $(srcdir) $(binding_outputdir)
+	$(mm_v_gen)$(gmmproc) $(gmmproc_flags) $* $(srcdir) $(binding_outputdir)
 
 # Instruct GNU make to delete the targets of a rule after it failed, in
 # order to avoid the complication of handling that situation manually.
diff --git a/configure.ac b/configure.ac
index 5525f0c..04bb3a3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,6 +20,7 @@ AC_PREREQ([2.59])
 AC_CONFIG_SRCDIR([util/mm-common-prepare.in])
 
 AM_INIT_AUTOMAKE([1.9 -Wno-portability check-news dist-bzip2 no-define std-options])
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
 AM_MAINTAINER_MODE
 
 AC_ARG_VAR([ACLOCAL_FLAGS], [aclocal flags, e.g. -I <macro dir>])



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