[v2] Add silent Makefile rules

Message ID 20180303182721.19009-1-simon.marchi@polymtl.ca
State New, archived
Headers

Commit Message

Simon Marchi March 3, 2018, 6:27 p.m. UTC
  New in v2:

- Enable Automake silent mode for our gnulib builds.
- Replace CC with CXX, LD with CXXLD.

Many projects (e.g. the Linux kernel) and build systems use "silent"
rules, which means that they'll only print a summary of what's being
done instead of printing all the detailed command lines.  While chatting
on the #gdb IRC channel, I realized a few people (including me) thought
it would be nice to have it in GDB too.

The idea is that too much text is not useful, the important information
gets lost.  If there's only the essential information, it's more likely
to be useful.  Most of the time, when I look at the build output, it's
to see how it's progressing.  By just printing a brief summary of each
operation, I can easily spot what's currently being compiled and
therefore how the build progresses (with time you know the order in
which files are compiled almost by heart).

As with other projects (Linux, automake-based things, probably others),
it's possible to print the complete command lines by passing V=1 to make
(or any other non-zero value).

I had one hesitation about this: when people report build failures, we
are more likely to miss the full compile command line.  We'll probably
sometimes need to ask people to include the build log with "make V=1".
I don't think it's a big downside, if other projects the size of the
Linux kernel can live with it, I'm sure we can too.

gdb/ChangeLog:

	* silent-rules.mk: New.
	* Makefile.in: Include silent-rules.mk
	(srcdir, VPATH, top_srcdir): Move up.
	(COMPILE): Add ECHO_CXX.
	(test-cp-name-parser$(EXEEXT)): Add ECHO_CXXLD.
	(init.c): Add ECHO_INIT_C.
	(gdb$(EXEEXT)): Add SILENCE and ECHO_CXXLD.
	(version.c): Add ECHO_GEN.
	(printcmd.o): Add ECHO_CXX.
	(target-float.o): Add ECHO_CXX.
	(ada-exp.o): Add ECHO_CXX.
	(stamp-xml): Add SILENCE and ECHO_GEN_XML_BUILTIN.
	(insight$(EXEEXT)): Add ECHO_CXXLD.
	* gnulib/configure.ac: Add AM_SILENT_RULES.
	* gnulib/aclocal.m4: Re-generate.
	* gnulib/configure: Re-generate.
	* gnulib/import/Makefile.in: Re-generate.

gdb/gdbserver/ChangeLog:

	* Makefile.in: Include silent-rules.mk.
	(srcdir, abs_top_srcdir, abs_srcdir, VPATH): Move up.
	(COMPILE): Add ECHO_CXX.
	(gdbserver$(EXEEXT)): Add SILENCE and ECHO_CXXLD.
	(gdbreplay$(EXEEXT)): Add SILENCE and ECHO_CXXLD.
	($(IPA_LIB)): Add SILENCE and ECHO_CXXLD.
	(version-generated.c): Add ECHO_GEN.
	(stamp-xml): Add SILENCE and ECHO_GEN_XML_BUILTIN_GENERATED.
	(IPAGENT_COMPILE): Add ECHO_CXX.
	(%-generated.c): Add ECHO_REGDAT.
---
 gdb/Makefile.in               | 51 +++++++++++++++++++-----------------
 gdb/gdbserver/Makefile.in     | 60 ++++++++++++++++++++++++-------------------
 gdb/gnulib/aclocal.m4         | 27 +++++++++++++++++++
 gdb/gnulib/configure          | 18 +++++++++++++
 gdb/gnulib/configure.ac       |  2 ++
 gdb/gnulib/import/Makefile.in | 32 ++++++++++++++++++-----
 gdb/silent-rules.mk           | 14 ++++++++++
 7 files changed, 147 insertions(+), 57 deletions(-)
 create mode 100644 gdb/silent-rules.mk
  

Comments

Simon Marchi March 16, 2018, 8:31 p.m. UTC | #1
On 2018-03-03 01:27 PM, Simon Marchi wrote:
> New in v2:
> 
> - Enable Automake silent mode for our gnulib builds.
> - Replace CC with CXX, LD with CXXLD.
> 
> Many projects (e.g. the Linux kernel) and build systems use "silent"
> rules, which means that they'll only print a summary of what's being
> done instead of printing all the detailed command lines.  While chatting
> on the #gdb IRC channel, I realized a few people (including me) thought
> it would be nice to have it in GDB too.
> 
> The idea is that too much text is not useful, the important information
> gets lost.  If there's only the essential information, it's more likely
> to be useful.  Most of the time, when I look at the build output, it's
> to see how it's progressing.  By just printing a brief summary of each
> operation, I can easily spot what's currently being compiled and
> therefore how the build progresses (with time you know the order in
> which files are compiled almost by heart).
> 
> As with other projects (Linux, automake-based things, probably others),
> it's possible to print the complete command lines by passing V=1 to make
> (or any other non-zero value).
> 
> I had one hesitation about this: when people report build failures, we
> are more likely to miss the full compile command line.  We'll probably
> sometimes need to ask people to include the build log with "make V=1".
> I don't think it's a big downside, if other projects the size of the
> Linux kernel can live with it, I'm sure we can too.

I pushed this patch.

Simon
  

Patch

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 19be64f226..42cc1dee9a 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -112,18 +112,20 @@  DEPMODE = @CCDEPMODE@
 DEPDIR = @DEPDIR@
 depcomp = $(SHELL) $(srcdir)/../depcomp
 
+# Directory containing source files.
+srcdir = @srcdir@
+VPATH = @srcdir@
+top_srcdir = @top_srcdir@
+
+include $(srcdir)/silent-rules.mk
+
 # Note that these are overridden by GNU make-specific code below if
 # GNU make is used.  The overrides implement dependency tracking.
 COMPILE.pre = $(CXX) -x c++ $(CXX_DIALECT)
 COMPILE.post = -c -o $@
-COMPILE = $(COMPILE.pre) $(INTERNAL_CFLAGS) $(COMPILE.post)
+COMPILE = $(ECHO_CXX) $(COMPILE.pre) $(INTERNAL_CFLAGS) $(COMPILE.post)
 POSTCOMPILE = @true
 
-# Directory containing source files.
-srcdir = @srcdir@
-VPATH = @srcdir@
-top_srcdir = @top_srcdir@
-
 YACC = @YACC@
 
 # This is used to rebuild ada-lex.c from ada-lex.l.  If the program is
@@ -1794,8 +1796,9 @@  test-cp-name-parser.o: cp-name-parser.c
 	$(POSTCOMPILE)
 
 test-cp-name-parser$(EXEEXT): test-cp-name-parser.o $(LIBIBERTY)
-	$(CC_LD) $(INTERNAL_LDFLAGS) -o test-cp-name-parser$(EXEEXT) \
-		test-cp-name-parser.o $(LIBIBERTY)
+	$(ECHO_CXXLD) $(CC_LD) $(INTERNAL_LDFLAGS) \
+		-o test-cp-name-parser$(EXEEXT) test-cp-name-parser.o \
+		$(LIBIBERTY)
 
 # We do this by grepping through sources.  If that turns out to be too slow,
 # maybe we could just require every .o file to have an initialization routine
@@ -1836,7 +1839,7 @@  test-cp-name-parser$(EXEEXT): test-cp-name-parser.o $(LIBIBERTY)
 
 INIT_FILES = $(COMMON_OBS) $(TSOBS) $(CONFIG_SRCS) $(SUBDIR_GCC_COMPILE_SRCS)
 init.c: $(INIT_FILES)
-	@echo Making init.c
+	@$(ECHO_INIT_C) echo "Making init.c"
 	@rm -f init.c-tmp init.l-tmp
 	@touch init.c-tmp
 	@echo gdbtypes > init.l-tmp
@@ -1896,8 +1899,8 @@  libgdb.a: $(LIBGDB_OBS)
 
 # Removing the old gdb first works better if it is running, at least on SunOS.
 gdb$(EXEEXT): gdb.o $(LIBGDB_OBS) $(ADD_DEPS) $(CDEPS) $(TDEPLIBS)
-	rm -f gdb$(EXEEXT)
-	$(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) \
+	$(SILENCE) rm -f gdb$(EXEEXT)
+	$(ECHO_CXXLD) $(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) \
 		-o gdb$(EXEEXT) gdb.o $(LIBGDB_OBS) \
 		$(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS) $(LOADLIBES)
 
@@ -2128,7 +2131,7 @@  $(srcdir)/copying.c: @MAINTAINER_MODE_TRUE@ $(srcdir)/../COPYING3 $(srcdir)/copy
 	mv $(srcdir)/copying.tmp $(srcdir)/copying.c
 
 version.c: Makefile version.in $(srcdir)/../bfd/version.h $(srcdir)/common/create-version.sh
-	$(SHELL) $(srcdir)/common/create-version.sh $(srcdir) \
+	$(ECHO_GEN) $(SHELL) $(srcdir)/common/create-version.sh $(srcdir) \
 	    $(host_alias) $(target_alias) version.c
 
 observer.h: observer.sh doc/observer.texi
@@ -2373,14 +2376,16 @@  ALLDEPFILES = \
 # Do not try to build "printcmd.c" with -Wformat-nonliteral.  It manually
 # checks format strings.
 printcmd.o: $(srcdir)/printcmd.c
-	$(COMPILE.pre) $(INTERNAL_CFLAGS) $(GDB_WARN_CFLAGS_NO_FORMAT) \
-		$(COMPILE.post) $(srcdir)/printcmd.c
+	$(ECHO_CXX) $(COMPILE.pre) $(INTERNAL_CFLAGS) \
+		$(GDB_WARN_CFLAGS_NO_FORMAT) $(COMPILE.post) \
+		$(srcdir)/printcmd.c
 	$(POSTCOMPILE)
 
 # Same for "target-float.c".
 target-float.o: $(srcdir)/target-float.c
-	$(COMPILE.pre) $(INTERNAL_CFLAGS) $(GDB_WARN_CFLAGS_NO_FORMAT) \
-		$(COMPILE.post) $(srcdir)/target-float.c
+	$(ECHO_CXX) $(COMPILE.pre) $(INTERNAL_CFLAGS) \
+		$(GDB_WARN_CFLAGS_NO_FORMAT) $(COMPILE.post) \
+		$(srcdir)/target-float.c
 
 # ada-exp.c can appear in srcdir, for releases; or in ., for
 # development builds.
@@ -2389,8 +2394,8 @@  ADA_EXP_C = `if test -f ada-exp.c; then echo ada-exp.c; else echo $(srcdir)/ada-
 # Some versions of flex give output that triggers
 # -Wold-style-definition.
 ada-exp.o: ada-exp.c
-	$(COMPILE.pre) $(INTERNAL_CFLAGS) $(GDB_WARN_CFLAGS_NO_DEFS) \
-		$(COMPILE.post) $(ADA_EXP_C)
+	$(ECHO_CXX) $(COMPILE.pre) $(INTERNAL_CFLAGS) \
+		$(GDB_WARN_CFLAGS_NO_DEFS) $(COMPILE.post) $(ADA_EXP_C)
 	$(POSTCOMPILE)
 
 # Message files.  Based on code in gcc/Makefile.in.
@@ -2521,12 +2526,12 @@  po/$(PACKAGE).pot: force
 
 xml-builtin.c: stamp-xml; @true
 stamp-xml: $(srcdir)/features/feature_to_c.sh Makefile $(XMLFILES)
-	rm -f xml-builtin.tmp
-	AWK="$(AWK)" \
+	$(SILENCE) rm -f xml-builtin.tmp
+	$(ECHO_GEN_XML_BUILTIN) AWK="$(AWK)" \
 	  $(SHELL) $(srcdir)/features/feature_to_c.sh \
 	  xml-builtin.tmp $(XMLFILES)
-	$(SHELL) $(srcdir)/../move-if-change xml-builtin.tmp xml-builtin.c
-	echo stamp > stamp-xml
+	$(SILENCE) $(SHELL) $(srcdir)/../move-if-change xml-builtin.tmp xml-builtin.c
+	$(SILENCE) echo stamp > stamp-xml
 
 .PRECIOUS: xml-builtin.c
 
@@ -2584,7 +2589,7 @@  clean-gdbtk:
 insight$(EXEEXT): gdbtk-main.o libgdb.a $(ADD_DEPS) \
 		$(CDEPS) $(TDEPLIBS)
 	rm -f insight$(EXEEXT)
-	$(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) \
+	$(ECHO_CXXLD) $(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) \
 		-o insight$(EXEEXT) gdbtk-main.o libgdb.a \
 		$(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS) $(LOADLIBES)
 
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index f2936920fe..75fbf7ec75 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -64,13 +64,6 @@  DEPMODE = @CCDEPMODE@
 DEPDIR = @DEPDIR@
 depcomp = $(SHELL) $(srcdir)/../depcomp
 
-# Note that these are overridden by GNU make-specific code below if
-# GNU make is used.  The overrides implement dependency tracking.
-COMPILE.pre = $(CXX) -x c++ $(CXX_DIALECT)
-COMPILE.post = -c -o $@
-COMPILE = $(COMPILE.pre) $(INTERNAL_CFLAGS) $(COMPILE.post)
-POSTCOMPILE = @true
-
 # Directory containing source files.  Don't clean up the spacing,
 # this exact string is matched for by the "configure" script.
 srcdir = @srcdir@
@@ -78,6 +71,15 @@  abs_top_srcdir = @abs_top_srcdir@
 abs_srcdir = @abs_srcdir@
 VPATH = @srcdir@
 
+include $(srcdir)/../silent-rules.mk
+
+# Note that these are overridden by GNU make-specific code below if
+# GNU make is used.  The overrides implement dependency tracking.
+COMPILE.pre = $(CXX) -x c++ $(CXX_DIALECT)
+COMPILE.post = -c -o $@
+COMPILE = $(ECHO_CXX) $(COMPILE.pre) $(INTERNAL_CFLAGS) $(COMPILE.post)
+POSTCOMPILE = @true
+
 # It is also possible that you will need to add -I/usr/include/sys to the
 # CFLAGS section if your system doesn't have fcntl.h in /usr/include (which
 # is where it should be according to Posix).
@@ -378,9 +380,10 @@  clean-info: force
 	@$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
 
 gdbserver$(EXEEXT): $(OBS) ${ADD_DEPS} ${CDEPS} $(LIBGNU) $(LIBIBERTY)
-	rm -f gdbserver$(EXEEXT)
-	$(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbserver$(EXEEXT) $(OBS) \
-	$(LIBGNU) $(LIBIBERTY) $(GDBSERVER_LIBS) $(XM_CLIBS)
+	$(SILENCE) rm -f gdbserver$(EXEEXT)
+	$(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
+		-o gdbserver$(EXEEXT) $(OBS) $(LIBGNU) $(LIBIBERTY) \
+		$(GDBSERVER_LIBS) $(XM_CLIBS)
 
 $(LIBGNU) $(LIBIBERTY) $(GNULIB_H): all-lib
 all-lib: $(GNULIB_BUILDDIR)/Makefile $(LIBIBERTY_BUILDDIR)/Makefile
@@ -388,9 +391,10 @@  all-lib: $(GNULIB_BUILDDIR)/Makefile $(LIBIBERTY_BUILDDIR)/Makefile
 .PHONY: all-lib
 
 gdbreplay$(EXEEXT): $(GDBREPLAY_OBS) $(LIBGNU) $(LIBIBERTY)
-	rm -f gdbreplay$(EXEEXT)
-	$(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbreplay$(EXEEXT) $(GDBREPLAY_OBS) \
-	  $(XM_CLIBS) $(LIBGNU) $(LIBIBERTY)
+	$(SILENCE) rm -f gdbreplay$(EXEEXT)
+	$(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
+		-o gdbreplay$(EXEEXT) $(GDBREPLAY_OBS) $(XM_CLIBS) $(LIBGNU) \
+		$(LIBIBERTY)
 
 IPA_OBJS = \
 	ax-ipa.o \
@@ -410,9 +414,10 @@  IPA_OBJS = \
 IPA_LIB = libinproctrace.so
 
 $(IPA_LIB): $(IPA_OBJS) ${ADD_DEPS} ${CDEPS}
-	rm -f $(IPA_LIB)
-	$(CC_LD) -shared -fPIC -Wl,--soname=$(IPA_LIB) -Wl,--no-undefined $(INTERNAL_CFLAGS) \
-	$(INTERNAL_LDFLAGS) -o $(IPA_LIB) ${IPA_OBJS} -ldl -pthread
+	$(SILENCE) rm -f $(IPA_LIB)
+	$(ECHO_CXXLD) $(CC_LD) -shared -fPIC -Wl,--soname=$(IPA_LIB) \
+		-Wl,--no-undefined $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
+		-o $(IPA_LIB) ${IPA_OBJS} -ldl -pthread
 
 # Put the proper machine-specific files first, so M-. on a machine
 # specific routine gets the one for the correct machine.
@@ -494,15 +499,16 @@  am--refresh:
 force:
 
 version-generated.c: Makefile $(srcdir)/../version.in $(srcdir)/../../bfd/version.h $(srcdir)/../common/create-version.sh
-	$(SHELL) $(srcdir)/../common/create-version.sh $(srcdir)/.. \
-	    $(host_alias) $(target_alias) $@
+	$(ECHO_GEN) $(SHELL) $(srcdir)/../common/create-version.sh $(srcdir)/.. \
+		$(host_alias) $(target_alias) $@
 
 xml-builtin-generated.c: stamp-xml; @true
 stamp-xml: $(XML_DIR)/feature_to_c.sh Makefile $(XML_FILES)
-	rm -f xml-builtin.tmp
-	$(SHELL) $(XML_DIR)/feature_to_c.sh xml-builtin.tmp $(XML_FILES)
-	$(SHELL) $(srcdir)/../../move-if-change xml-builtin.tmp xml-builtin-generated.c
-	echo stamp > stamp-xml
+	$(SILENCE) rm -f xml-builtin.tmp
+	$(ECHO_GEN_XML_BUILTIN_GENERATED) $(SHELL) $(XML_DIR)/feature_to_c.sh \
+		xml-builtin.tmp $(XML_FILES)
+	$(SILENCE) $(SHELL) $(srcdir)/../../move-if-change xml-builtin.tmp xml-builtin-generated.c
+	$(SILENCE) echo stamp > stamp-xml
 
 .PRECIOUS: xml-builtin.c
 
@@ -527,7 +533,7 @@  IPAGENT_CFLAGS = $(INTERNAL_CFLAGS) $(UST_CFLAGS) \
 	-fPIC -DIN_PROCESS_AGENT \
 	-fvisibility=hidden
 
-IPAGENT_COMPILE = $(COMPILE.pre) $(IPAGENT_CFLAGS) $(COMPILE.post)
+IPAGENT_COMPILE = $(ECHO_CXX) $(COMPILE.pre) $(IPAGENT_CFLAGS) $(COMPILE.post)
 
 # Rules for special cases.
 
@@ -598,16 +604,16 @@  common/%.o: ../common/%.c
 # -generated to identify and clean them easily.
 
 %-generated.c: ../regformats/%.dat | $(regdat_sh)
-	$(SHELL) $(regdat_sh) $< $@
+	$(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@
 
 %-generated.c: ../regformats/arm/%.dat | $(regdat_sh)
-	$(SHELL) $(regdat_sh) $< $@
+	$(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@
 
 %-generated.c: ../regformats/i386/%.dat | $(regdat_sh)
-	$(SHELL) $(regdat_sh) $< $@
+	$(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@
 
 %-generated.c: ../regformats/rs6000/%.dat | $(regdat_sh)
-	$(SHELL) $(regdat_sh) $< $@
+	$(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@
 
 #
 # Dependency tracking.
diff --git a/gdb/gnulib/aclocal.m4 b/gdb/gnulib/aclocal.m4
index 0b4aa1be93..f551841327 100644
--- a/gdb/gnulib/aclocal.m4
+++ b/gdb/gnulib/aclocal.m4
@@ -869,6 +869,33 @@  Check your system clock])
 fi
 AC_MSG_RESULT(yes)])
 
+# Copyright (C) 2009  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 1
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# (`yes' being less verbose, `no' or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules],
+[  --enable-silent-rules          less verbose build output (undo: `make V=1')
+  --disable-silent-rules         verbose build output (undo: `make V=0')])
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no)  AM_DEFAULT_VERBOSITY=1;;
+*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
 # Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
diff --git a/gdb/gnulib/configure b/gdb/gnulib/configure
index 893f9427c8..d5bf01ee6e 100644
--- a/gdb/gnulib/configure
+++ b/gdb/gnulib/configure
@@ -600,6 +600,8 @@  gl_LIBOBJS
 LTLIBOBJS
 LIBOBJS
 LN_S
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
 am__fastdepCC_FALSE
 am__fastdepCC_TRUE
 CCDEPMODE
@@ -1694,6 +1696,7 @@  enable_option_checking
 enable_maintainer_mode
 enable_largefile
 enable_dependency_tracking
+enable_silent_rules
 '
       ac_precious_vars='build_alias
 host_alias
@@ -2327,6 +2330,8 @@  Optional Features:
   --disable-largefile     omit support for large files
   --disable-dependency-tracking  speeds up one-time build
   --enable-dependency-tracking   do not reject slow dependency extractors
+  --enable-silent-rules          less verbose build output (undo: `make V=1')
+  --disable-silent-rules         verbose build output (undo: `make V=0')
 
 Some influential environment variables:
   CC          C compiler command
@@ -23980,6 +23985,19 @@  fi
 
 
 
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+  enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no)  AM_DEFAULT_VERBOSITY=1;;
+*)   AM_DEFAULT_VERBOSITY=0;;
+esac
+AM_BACKSLASH='\'
+
+
 # --------------------- #
 # Checks for programs.  #
 # --------------------- #
diff --git a/gdb/gnulib/configure.ac b/gdb/gnulib/configure.ac
index 1be215254b..3d70b23396 100644
--- a/gdb/gnulib/configure.ac
+++ b/gdb/gnulib/configure.ac
@@ -37,6 +37,8 @@  gl_INIT
 # its Makefile.in.
 AM_INIT_AUTOMAKE(libgnu, UNUSED-VERSION, [no-define])
 
+AM_SILENT_RULES([yes])
+
 # --------------------- #
 # Checks for programs.  #
 # --------------------- #
diff --git a/gdb/gnulib/import/Makefile.in b/gdb/gnulib/import/Makefile.in
index fbaa140cda..7706e8be47 100644
--- a/gdb/gnulib/import/Makefile.in
+++ b/gdb/gnulib/import/Makefile.in
@@ -193,6 +193,12 @@  CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
 LIBRARIES = $(noinst_LIBRARIES)
+AM_V_AR = $(am__v_AR_$(V))
+am__v_AR_ = $(am__v_AR_$(AM_DEFAULT_VERBOSITY))
+am__v_AR_0 = @echo "  AR    " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
 libgnu_a_AR = $(AR) $(ARFLAGS)
 am__DEPENDENCIES_1 =
 am_libgnu_a_OBJECTS = cloexec.$(OBJEXT) dirname-lgpl.$(OBJEXT) \
@@ -212,8 +218,17 @@  am__depfiles_maybe = depfiles
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo "  CC    " $@;
 CCLD = $(CC)
 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo "  CCLD  " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN   " $@;
 SOURCES = $(libgnu_a_SOURCES) $(EXTRA_libgnu_a_SOURCES)
 DIST_SOURCES = $(libgnu_a_SOURCES) $(EXTRA_libgnu_a_SOURCES)
 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
@@ -263,6 +278,7 @@  ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
 ALLOCA_H = @ALLOCA_H@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
 AR = @AR@
 ARFLAGS = @ARFLAGS@
@@ -1484,9 +1500,9 @@  $(am__aclocal_m4_deps):
 clean-noinstLIBRARIES:
 	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
 libgnu.a: $(libgnu_a_OBJECTS) $(libgnu_a_DEPENDENCIES) 
-	-rm -f libgnu.a
-	$(libgnu_a_AR) libgnu.a $(libgnu_a_OBJECTS) $(libgnu_a_LIBADD)
-	$(RANLIB) libgnu.a
+	$(AM_V_at)-rm -f libgnu.a
+	$(AM_V_AR)$(libgnu_a_AR) libgnu.a $(libgnu_a_OBJECTS) $(libgnu_a_LIBADD)
+	$(AM_V_at)$(RANLIB) libgnu.a
 
 clean-noinstLTLIBRARIES:
 	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
@@ -1591,15 +1607,17 @@  distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wctype-h.Po@am__quote@
 
 .c.o:
-@am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c $<
 
 .c.obj:
-@am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
diff --git a/gdb/silent-rules.mk b/gdb/silent-rules.mk
new file mode 100644
index 0000000000..803dbda546
--- /dev/null
+++ b/gdb/silent-rules.mk
@@ -0,0 +1,14 @@ 
+# If V is undefined or V=0 is specified, use the silent/verbose/compact mode.
+V ?= 0
+ifeq ($(V),0)
+ECHO_CXX =    @echo "  CXX    $@";
+ECHO_CXXLD =  @echo "  CXXLD  $@";
+ECHO_REGDAT = @echo "  REGDAT $@";
+ECHO_GEN =    @echo "  GEN    $@";
+ECHO_GEN_XML_BUILTIN = \
+              @echo "  GEN    xml-builtin.c";
+ECHO_GEN_XML_BUILTIN_GENERATED = \
+              @echo "  GEN    xml-builtin-generated.c";
+ECHO_INIT_C =  echo "  GEN    init.c" ||
+SILENCE = @
+endif