]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/build: apply silent-rules.mk to the data-directory Makefile.in
authorAndrew Burgess <aburgess@redhat.com>
Sat, 6 Apr 2024 16:28:37 +0000 (17:28 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Mon, 8 Apr 2024 09:25:42 +0000 (10:25 +0100)
This commit makes use of gdb/silent-rules.mk in the data-directory
Makefile.in.  I've only updated the rules that actually generate
things, I've not touched the install or uninstall rules, this matches
gdb/Makefile.in.

I've not managed to completely silence all of the recipe output, the
mkinstalldirs command outputs some diagnostic text which looks like
this:

    GEN    stamp-python
  mkdir -p -- ./python/gdb
  mkdir -p -- ./python/gdb/command
  mkdir -p -- ./python/gdb/dap
  mkdir -p -- ./python/gdb/function
  mkdir -p -- ./python/gdb/printer

I have a patch for mkinstalldirs that fixes this (by adding a new
--silent command line flag), but that patch needs to be submitted to
automake, then an updated mkinstalldirs sync'd to the gcc repository,
and then copied into the binutils-gdb repository... so I'm leaving
that for a future project.

Then the guild compiler also emits some diagnostic output, which looks
like this:

    GEN    stamp-guile
  mkdir -p -- ./guile/.
  mkdir -p -- ./guile/gdb
  wrote `./gdb.go'
  wrote `gdb/experimental.go'
  wrote `gdb/iterator.go'
  wrote `gdb/printing.go'
  wrote `gdb/support.go'
  wrote `gdb/types.go'

The 'wrote' lines are from the guild compiler.  The only way to
silence these would be to redirect stdout to /dev/null I think.  I did
prototype this, but wasn't 100% convinced about that part of the
patch, so I've decided to leave that for another day.

I did need to add a new SILENT_ECHO variable to silent-rules.mk, this
is set to a suitable 'echo' command to use within recipes.  When we
are in silent mode then I use the 'true' command, while in verbose
mode we actually use 'echo'.

So, other than the issues outlined above, the output when building the
data-directory is now greatly reduced, and more inline with the output
when building in the gdb/ directory.

There should be no change in what is actually built after this commit.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
gdb/data-directory/Makefile.in
gdb/silent-rules.mk

index edfa52c2217bf127b90945f88d27af96b9d31089..720b983ef6cb82dd7ff69b700e44bff1910d5e12 100644 (file)
@@ -36,6 +36,8 @@ exec_prefix = @exec_prefix@
 datarootdir = @datarootdir@
 datadir = @datadir@
 
+include $(srcdir)/../silent-rules.mk
+
 SHELL = @SHELL@
 
 LN_S = @LN_S@
@@ -202,7 +204,7 @@ FLAGS_TO_PASS = \
 all: stamp-syscalls stamp-python stamp-guile stamp-system-gdbinit
 
 %.xml: @MAINTAINER_MODE_TRUE@ %.xml.in apply-defaults.xsl linux-defaults.xml.in
-       $(XSLTPROC) -o $(SYSCALLS_SRCDIR)/$@ $(SYSCALLS_SRCDIR)/apply-defaults.xsl\
+       $(ECHO_GEN) $(XSLTPROC) -o $(SYSCALLS_SRCDIR)/$@ $(SYSCALLS_SRCDIR)/apply-defaults.xsl \
                $(SYSCALLS_SRCDIR)/$@.in
 
 .PHONY: syscall-xml
@@ -219,16 +221,17 @@ clean-syscall-xml:
 # For portability's sake, we need to handle systems that don't have
 # symbolic links.
 stamp-syscalls: Makefile $(SYSCALLS_FILES)
-       rm -rf ./$(SYSCALLS_DIR)
-       mkdir ./$(SYSCALLS_DIR)
-       files='$(SYSCALLS_FILES)' ; \
+       $(ECHO_GEN)
+       $(SILENCE) rm -rf ./$(SYSCALLS_DIR)
+       $(SILENCE) mkdir ./$(SYSCALLS_DIR)
+       $(SILENCE) files='$(SYSCALLS_FILES)' ; \
        for file in $$files ; do \
          f=$(SYSCALLS_SRCDIR)/$$file ; \
          if test -f $$f ; then \
            $(INSTALL_DATA) $$f ./$(SYSCALLS_DIR) ; \
          fi ; \
        done
-       touch $@
+       $(SILENCE) touch $@
 
 .PHONY: clean-syscalls
 clean-syscalls:
@@ -262,8 +265,9 @@ uninstall-syscalls:
        done
 
 stamp-python: Makefile $(PYTHON_FILES)
-       rm -rf ./$(PYTHON_DIR)
-       files='$(PYTHON_FILES)' ; \
+       $(ECHO_GEN)
+       $(SILENCE) rm -rf ./$(PYTHON_DIR)
+       $(SILENCE) files='$(PYTHON_FILES)' ; \
        if test "x$$files" != x ; then \
          for file in $$files ; do \
            dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
@@ -271,7 +275,7 @@ stamp-python: Makefile $(PYTHON_FILES)
            $(INSTALL_DATA) $(PYTHON_SRCDIR)/$$file ./$(PYTHON_DIR)/$$dir ; \
          done ; \
        fi
-       touch $@
+       $(SILENCE) touch $@
 
 .PHONY: clean-python
 clean-python:
@@ -305,8 +309,9 @@ uninstall-python:
        fi
 
 stamp-guile: Makefile $(GUILE_SOURCE_FILES)
-       rm -rf ./$(GUILE_DIR)
-       if test "x$(GUILE_FILES)" != x ; then \
+       $(ECHO_GEN)
+       $(SILENCE) rm -rf ./$(GUILE_DIR)
+       $(SILENCE) if test "x$(GUILE_FILES)" != x ; then \
          files='$(GUILE_SOURCE_FILES)' ; \
          for file in $$files ; do \
            dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
@@ -317,11 +322,11 @@ stamp-guile: Makefile $(GUILE_SOURCE_FILES)
          cd ./$(GUILE_DIR) ; \
          for go in $$files ; do \
            source="`echo $$go | sed 's/\.go$$/.scm/'`" ; \
-           echo $(GUILD) compile $(GUILD_COMPILE_FLAGS) -o "$$go" "$$source" ; \
+           $(SILENT_ECHO) $(GUILD) compile $(GUILD_COMPILE_FLAGS) -o "$$go" "$$source" ; \
            $(GUILD) compile $(GUILD_COMPILE_FLAGS) -o "$$go" "$$source" || exit 1 ; \
          done ; \
        fi
-       touch $@
+       $(SILENCE) touch $@
 
 .PHONY: clean-guile
 clean-guile:
@@ -355,16 +360,17 @@ uninstall-guile:
        fi
 
 stamp-system-gdbinit: Makefile $(SYSTEM_GDBINIT_FILES)
-       rm -rf ./$(SYSTEM_GDBINIT_DIR)
-       mkdir ./$(SYSTEM_GDBINIT_DIR)
-       files='$(SYSTEM_GDBINIT_FILES)' ; \
+       $(ECHO_GEN)
+       $(SILENCE) rm -rf ./$(SYSTEM_GDBINIT_DIR)
+       $(SILENCE) mkdir ./$(SYSTEM_GDBINIT_DIR)
+       $(SILENCE) files='$(SYSTEM_GDBINIT_FILES)' ; \
        for file in $$files ; do \
          f=$(SYSTEM_GDBINIT_SRCDIR)/$$file ; \
          if test -f $$f ; then \
            $(INSTALL_DATA) $$f ./$(SYSTEM_GDBINIT_DIR) ; \
          fi ; \
        done
-       touch $@
+       $(SILENCE) touch $@
 
 .PHONY: clean-system-gdbinit
 clean-system-gdbinit:
@@ -438,7 +444,7 @@ clean-info:
 MAKEOVERRIDES=
 
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-       cd .. && $(SHELL) ./config.status data-directory/Makefile
+       $(ECHO_GEN) cd .. && $(SHELL) ./config.status $(SILENT_FLAG) data-directory/Makefile
 
 # Disable implicit make rules.
 include $(srcdir)/../disable-implicit-rules.mk
index 36791f6683ffd4940e16903d4ab6c9fd0ae96478..43dc2bf3aca9edce706dc3f68bc549806bb9beed 100644 (file)
@@ -20,4 +20,8 @@ ECHO_RANLIB = @echo "  RANLIB $@";
 SILENCE = @
 # Silence libtool.
 SILENT_FLAG = --silent
+# Used in shell snippets instead of 'echo'.
+SILENT_ECHO = true
+else
+SILENT_ECHO = echo
 endif