From patchwork Sat Apr 6 17:03:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 88131 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A695838449C7 for ; Sat, 6 Apr 2024 17:04:16 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id F25523858435 for ; Sat, 6 Apr 2024 17:03:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F25523858435 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org F25523858435 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712423016; cv=none; b=dqn09giKvlpJUEAcH+FaryjLh7Gcw5qWj5p6q87zh+ctT7ehji7KGv9p91KK5WQF61L0+vkMPsGibTz52J2jb++St6Qf3ybtRG3BEASAEqhLH3QaLVhfIcd8i3f7fRCwxcPjhsDyCqsfTHrOVk4sc0CzsfK173U9ADwBNwAlakY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712423016; c=relaxed/simple; bh=cOsmv/6vC5SoGbT7Drc/LkReSavEM64bIOEws58o+QQ=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=GqwW43T3e9vgzAiW7ctE2+afGTAov+N6N36NPOodL1ZZQhhWdW+8DHNuSPbCFlku3sMiSKSwaIM+AJNsuID3n0+pqHVS1Tfqqf4Prfa8iRU3GTiT6XJwENpe4nmRJElR3l9D9oxo9Cid1qZg+0v2sWrXJF8gQYk8YJXmNKpBwV4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712423012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=W6fICFjL6ESMtcpSxnw1hwZPAjO1RJin6WOXrfkkFBA=; b=QHxZ61E3Lbhrir6XaicLlIpc5Ug2lIlq+USdQWLnrZRMKVj7hwfHUIAcl4ectPQdsxZqRW /i4uh+7DV08SlN8o24XaBNRTYPyfDNYdeWifVdaCgpxbdEbEGemQpf8qdHHNFgMEqpJUXv Y/ir8oSFOn7PJhlrmjwnWslj/16Gm7c= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-572-BYIHHwHkM06_NIlTaZQCOA-1; Sat, 06 Apr 2024 13:03:31 -0400 X-MC-Unique: BYIHHwHkM06_NIlTaZQCOA-1 Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-56e242ec7ffso1227520a12.3 for ; Sat, 06 Apr 2024 10:03:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712423010; x=1713027810; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=W6fICFjL6ESMtcpSxnw1hwZPAjO1RJin6WOXrfkkFBA=; b=WHedzjdBFU3HL972YQj3IHYCZQqXCsCGUYlTHt9k7lwUqMXnZrroK6pLcsCI9YUxhU uX4NbxV8iK8i4hxJ0ZKsElW/GKWiSoLXXDVM27XdTcidYuZczaNiIUAK7XCNwrx4elXQ BVWLTmVQ7we+tB4ynX5gCFwLz1bthBG8KC6ab/tWVhH+LBkycarJp+T+YRVFH0NyH1cC eNAcyczqYTaiaHxwsvWV2CctF70CZm8l9Mja4p+d2P8LnVMaKb66aP86Ay00nyiz4HQl yR/EVN0I5FKzfK9Yq8HFAzI0MwNQDPCnIfaunrPr8poIOted45EO+BkvE8N4AhiU7n9S a3/Q== X-Gm-Message-State: AOJu0YwubRFSLxK6k4bDA4LEpcrVRNxX8zMyxGZe3yXEd9JBVvyycqRt KIMAiybLBRDcs4YKp9cDhg1CkgsBLdbYY2OVawkq5rEAzLMihQSgngUrZEBGQYRYfeegZfOOwcC e/YIbLX2VFOHlln4YrUY2jlQqp94lPKeOJTlSX/pHreXtWKpoDqdUayQEq4xvXRXanGyfOTxXSM axGtkpJtUKgFEci3u1kk/zaa0/5Ui+0PptXR34hXaQBbA= X-Received: by 2002:a50:8acc:0:b0:56b:9ef8:f630 with SMTP id k12-20020a508acc000000b0056b9ef8f630mr3153637edk.2.1712423009489; Sat, 06 Apr 2024 10:03:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEhn1XV5BILz8PwDAvDLE/Z7vRV6VPDDaxPNNoRvhZv5aBNiiR4rUBAad2plodq0/r3oepblw== X-Received: by 2002:a50:8acc:0:b0:56b:9ef8:f630 with SMTP id k12-20020a508acc000000b0056b9ef8f630mr3153627edk.2.1712423009035; Sat, 06 Apr 2024 10:03:29 -0700 (PDT) Received: from localhost (185.223.159.143.dyn.plus.net. [143.159.223.185]) by smtp.gmail.com with ESMTPSA id b93-20020a509f66000000b0056e0376286bsm2116883edf.24.2024.04.06.10.03.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Apr 2024 10:03:28 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCHv2 6/6] gdb/build: apply silent-rules.mk to the data-directory Makefile.in Date: Sat, 6 Apr 2024 18:03:15 +0100 Message-Id: <97d0a17d1cc2414b98d1dd6bd0344748400b30c4.1712422921.git.aburgess@redhat.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org 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. --- gdb/data-directory/Makefile.in | 40 +++++++++++++++++++--------------- gdb/silent-rules.mk | 4 ++++ 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in index edfa52c2217..720b983ef6c 100644 --- a/gdb/data-directory/Makefile.in +++ b/gdb/data-directory/Makefile.in @@ -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 diff --git a/gdb/silent-rules.mk b/gdb/silent-rules.mk index 36791f6683f..43dc2bf3aca 100644 --- a/gdb/silent-rules.mk +++ b/gdb/silent-rules.mk @@ -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