Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: Mike Frysinger <vapier@gentoo.org>, gdb-patches@sourceware.org
Subject: Re: [PATCH/committed] sim: enable silent rules in common builds
Date: Mon, 14 Jun 2021 20:40:23 -0400	[thread overview]
Message-ID: <0decd618-86e7-85db-5b95-db7454c07d61@polymtl.ca> (raw)
In-Reply-To: <20210615000234.1211-1-vapier@gentoo.org>

On 2021-06-14 8:02 p.m., Mike Frysinger via Gdb-patches wrote:
> We only do the common code as automake simplifies the logic.

Are you interested in re-using what is done in GDB?  I did this quickly
to show how it works.  It covers maybe 90% of the commands with very little
effort.


From 3c9546a131a0d0309232919ab6f58ced6109a1d8 Mon Sep 17 00:00:00 2001
From: Simon Marchi <simon.marchi@polymtl.ca>
Date: Mon, 14 Jun 2021 20:39:04 -0400
Subject: [PATCH] silent

Change-Id: Idf9ba5beaee10c7c614859ace5fbdcd1de0287db
---
 gdb/silent-rules.mk       |  3 +++
 sim/common/Make-common.in | 10 ++++++----
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/gdb/silent-rules.mk b/gdb/silent-rules.mk
index 772bd6728be3..97d799bf2ae2 100644
--- a/gdb/silent-rules.mk
+++ b/gdb/silent-rules.mk
@@ -4,6 +4,7 @@ ifeq ($(V),0)
 ECHO_CXX =    @echo "  CXX    $@";
 ECHO_CC  =    @echo "  CC     $@";
 ECHO_CXXLD =  @echo "  CXXLD  $@";
+ECHO_CCLD =   @echo "  CCLD  $@";
 ECHO_REGDAT = @echo "  REGDAT $@";
 ECHO_GEN =    @echo "  GEN    $@";
 ECHO_GEN_XML_BUILTIN = \
@@ -14,5 +15,7 @@ ECHO_INIT_C = @echo "  GEN    init.c"
 ECHO_SIGN =   @echo "  SIGN   gdb";
 ECHO_YACC =   @echo "  YACC   $@";
 ECHO_LEX  =   @echo "  LEX    $@";
+ECHO_AR =     @echo "  AR     $@";
+ECHO_RANLIB = @echo "  RANLIB $@";
 SILENCE = @
 endif
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index 3dab9ca1fd14..54e641eaa543 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -40,6 +40,8 @@ srccom = $(srcdir)/../common
 srcroot = $(srcdir)/../..
 srcsim = $(srcdir)/..
 
+include $(srcroot)/gdb/silent-rules.mk
+
 # Helper code from gnulib.
 GNULIB_PARENT_DIR = ../..
 include $(GNULIB_PARENT_DIR)/gnulib/Makefile.gnulib.inc
@@ -111,7 +113,7 @@ depcomp = $(SHELL) $(srcroot)/depcomp
 # GNU make is used.  The overrides implement dependency tracking.
 COMPILE.pre = $(CC) $(C_DIALECT)
 COMPILE.post = -c -o $@
-COMPILE = $(COMPILE.pre) $(ALL_CFLAGS) $(COMPILE.post)
+COMPILE = $(ECHO_CC) $(COMPILE.pre) $(ALL_CFLAGS) $(COMPILE.post)
 POSTCOMPILE = @true
 
 # igen leaks memory, and therefore makes AddressSanitizer unhappy.  Disable
@@ -273,11 +275,11 @@ all: libsim.a run$(EXEEXT) .gdbinit
 
 libsim.a: $(LIB_OBJS)
 	rm -f libsim.a
-	$(AR) $(AR_FLAGS) libsim.a $(LIB_OBJS)
-	$(RANLIB) libsim.a
+	$(ECHO_AR) $(AR) $(AR_FLAGS) libsim.a $(LIB_OBJS)
+	$(ECHO_RANLIB) $(RANLIB) libsim.a
 
 run$(EXEEXT): $(SIM_RUN_OBJS) libsim.a $(LIBDEPS)
-	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o run$(EXEEXT) \
+	$(ECHO_CCLD) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o run$(EXEEXT) \
 	  $(SIM_RUN_OBJS) libsim.a $(EXTRA_LIBS)
 
 # FIXME: Ideally, callback.o and friends live in a library outside of
-- 
2.32.0


  reply	other threads:[~2021-06-15  0:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-15  0:02 Mike Frysinger via Gdb-patches
2021-06-15  0:40 ` Simon Marchi via Gdb-patches [this message]
2021-06-15  0:52   ` Mike Frysinger via Gdb-patches
2021-06-15  0:53     ` Simon Marchi via Gdb-patches
2021-06-15  1:43       ` Mike Frysinger via Gdb-patches
2021-06-16 15:59         ` Simon Marchi via Gdb-patches
2021-06-17  4:22           ` Mike Frysinger via Gdb-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0decd618-86e7-85db-5b95-db7454c07d61@polymtl.ca \
    --to=gdb-patches@sourceware.org \
    --cc=simon.marchi@polymtl.ca \
    --cc=vapier@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox