From patchwork Sun Nov 27 22:42:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Smith X-Patchwork-Id: 13056869 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF31BC46467 for ; Sun, 27 Nov 2022 22:43:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229676AbiK0Wn3 (ORCPT ); Sun, 27 Nov 2022 17:43:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229615AbiK0Wn1 (ORCPT ); Sun, 27 Nov 2022 17:43:27 -0500 Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A546642D for ; Sun, 27 Nov 2022 14:43:25 -0800 (PST) Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozQMq-0004h3-Sf; Sun, 27 Nov 2022 17:43:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=EsI6UM+HpB4dkUVyTOOFUJw7nv7S8lGOvQ9XQKVVK90=; b=rQUzo70smXRJ1q40gbu1 UHtBSjPItdIOw8QOEzGuXJ6Hny55olgve6qrw7QKUMKmD69e0NDGAoqMFC5y2dT4lvxOKagEYtV1b ke7Dqt8sbR5GqZsehvjXvPmk2nclUQSCGaVLsnPXZ0apiYLvXHfnNvSsImi9QurYX1bLAuaqDx+hO X0TjTkg1SjsnBiFfkGLyfbVb8k+/LArJT5iqgIkKNHJqEsvAy4Yl5I+DC0ZfeCZnzwM9XyGu5y54k abTGoUY9VTSQsjIjlHCwLNL1K0St5U3wEIHNZhJl/KSn6LBfVuFZYxaVHglglECWsspKWGjcQ7dto INSrKQfdCR+vRw==; Received: from pool-71-245-225-93.bstnma.fios.verizon.net ([71.245.225.93] helo=llin-psh13-dsa.internal.nuodb.com) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ozQMq-0004HF-Kl; Sun, 27 Nov 2022 17:43:20 -0500 From: Paul Smith To: git@vger.kernel.org Cc: avarab@gmail.com, Alexander Kanavin Subject: [PATCH 1/1] Avoid multiple patterns when recipes generate one file Date: Sun, 27 Nov 2022 17:42:51 -0500 Message-Id: <20221127224251.2508200-2-psmith@gnu.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20221127224251.2508200-1-psmith@gnu.org> References: <20221127224251.2508200-1-psmith@gnu.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org A GNU make pattern rule with multiple targets has always meant that a single invocation of the recipe will build all the targets. However in older versions of GNU make a recipe that did not really build all the targets would be tolerated. Starting with GNU make 4.4 this behavior is deprecated and pattern rules are expected to generate files to match all the patterns. If not all targets are created then GNU make will not consider any target up to date and will re-run the recipe when it is run again. Modify Documentation/Makefile to split the man page-creating pattern rule into a separate pattern rule for each pattern. Reported-by: Alexander Kanavin Signed-off-by: Paul Smith --- Documentation/Makefile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Documentation/Makefile b/Documentation/Makefile index d47acb2e25..21375cd3f2 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -351,8 +351,16 @@ $(OBSOLETE_HTML): %.html : %.txto $(ASCIIDOC_DEPS) manpage-base-url.xsl: manpage-base-url.xsl.in $(QUIET_GEN)sed "s|@@MAN_BASE_URL@@|$(MAN_BASE_URL)|" $< > $@ -%.1 %.5 %.7 : %.xml manpage-base-url.xsl $(wildcard manpage*.xsl) - $(QUIET_XMLTO)$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $< + +manpage-prereqs := manpage-base-url.xsl $(wildcard manpage*.xsl) +manpage-cmd = $(QUIET_XMLTO)$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $< + +%.1 : %.xml $(manpage-prereqs) + $(manpage-cmd) +%.5 : %.xml $(manpage-prereqs) + $(manpage-cmd) +%.7 : %.xml $(manpage-prereqs) + $(manpage-cmd) %.xml : %.txt $(ASCIIDOC_DEPS) $(QUIET_ASCIIDOC)$(TXT_TO_XML) -d manpage -o $@ $< From patchwork Tue Nov 29 14:09:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 13058604 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C2FCC4321E for ; Tue, 29 Nov 2022 14:09:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235123AbiK2OJ2 (ORCPT ); Tue, 29 Nov 2022 09:09:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235056AbiK2OJZ (ORCPT ); Tue, 29 Nov 2022 09:09:25 -0500 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A45D5FB94 for ; Tue, 29 Nov 2022 06:09:24 -0800 (PST) Received: by mail-ej1-x634.google.com with SMTP id n20so34133103ejh.0 for ; Tue, 29 Nov 2022 06:09:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FwH4/6NwQWWSsPjtqoIcS7LKf3MBF4D2MdfVYtdQ8mA=; b=H+C+QDTDL2bxXZCen6LZp5XqvdSxE20pPjhhiTJdtl+iBInLWgkOTLsnLtnUaxa2qT 2Mqo+WtWRwhk1sLwDBH8s6MDKoMX/4qwmXS9So18rkAikxeIw7qmLKVAbsm1be21Xm8x 65FS3m7co+lntHTOGb8BG5ivSaOvnXZbM7spkNVADzF/t2u0CaQztue0YgB2pFUi2k9O 2mlnY5BhEfPr0JbGT+gYZqCeHUslB4K90YMoSaadq+Z2M+QlSLEXsdZIlNLazutcfE3s BC6sBHZMT5wCm2cEM4nmLfApbz11M7eyxAApdoP/8E2nEtyH5fl0sCCixcTjHVG8/khD UHVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=FwH4/6NwQWWSsPjtqoIcS7LKf3MBF4D2MdfVYtdQ8mA=; b=g8XMs4asuNHEyBc2unjX7gn060dcFJUILI4L5r//bIxr9yAmWlg2OgWh5U70HlL1Qt CO7eaVxuIRZfvWlKZf3AuPZ7/cI1AxMHyxSZR2BdBYihKAug7fVxbn15KQWmu7Vpdp2b lj8XvxkMG1IyO4qe+tpgjvHuwpMlnyv2fJI4W2hVMN5D2bCNfPIIMfVm0qR3mmkwGa/C cC0FpxuQPdmZLJbpXiuQ4LC7Yc5ZrWWWrn/HUuo4d4VfYXh+FrcjFUdCWTSPesmVzwOw web8L96Qwqq++mGtRNE+cHG0d4xAnrrQiZSJrU5kESlgAIQEHoEt4ghezpwSEBMNvQjc Xagg== X-Gm-Message-State: ANoB5pnX6Vfk6G5tJAMJwvNRxQ3YYuW53VZKRfLdZb0zRE60z+YIAUKc 7dUCR+KwQrDbLUsDEw99efsoaghOCYsyqw== X-Google-Smtp-Source: AA0mqf5SC9oOhSzl8wdlVdOuDa7BgR1YF5vVcWPkhqOAoku1b2c0eWh9A4cC9csTkEo437SOMUp3YA== X-Received: by 2002:a17:906:6dd7:b0:7a1:1c24:e564 with SMTP id j23-20020a1709066dd700b007a11c24e564mr36315867ejt.629.1669730962266; Tue, 29 Nov 2022 06:09:22 -0800 (PST) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id be14-20020a0564021a2e00b00463597d2c25sm6307907edb.74.2022.11.29.06.09.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 06:09:21 -0800 (PST) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Paul Smith , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Subject: [PATCH v2 3/4] Makefiles: change search through $(MAKEFLAGS) for GNU make 4.4 Date: Tue, 29 Nov 2022 15:09:16 +0100 Message-Id: X-Mailer: git-send-email 2.39.0.rc0.993.g0c499e58e3b In-Reply-To: References: <20221127224251.2508200-1-psmith@gnu.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Since GNU make 4.4 the semantics of the $(MAKEFLAGS) variable has changed in a backward-incompatible way, as its "NEWS" file notes: Previously only simple (one-letter) options were added to the MAKEFLAGS variable that was visible while parsing makefiles. Now, all options are available in MAKEFLAGS. If you want to check MAKEFLAGS for a one-letter option, expanding "$(firstword -$(MAKEFLAGS))" is a reliable way to return the set of one-letter options which can be examined via findstring, etc. This upstream change meant that e.g.: make man Would become very noisy, because in shared.mak we rely on extracting "s" from the $(MAKEFLAGS), which now contains long options like "--jobserver-auth=fifo:", which we'll conflate with the "-s" option. So, let's change this idiom we've been carrying since [1], [2] and [3] as the "NEWS" suggests. Note that the "-" in "-$(MAKEFLAGS)" is critical here, as the variable will always contain leading whitespace if there are no short options, but long options are present. Without it e.g. "make --debug=all" would yield "--debug=all" as the first word, but with it we'll get "-" as intended. Then "-s" for "-s", "-Bs" for "-s -B" etc. 1. 0c3b4aac8ec (git-gui: Support of "make -s" in: do not output anything of the build itself, 2007-03-07) 2. b777434383b (Support of "make -s": do not output anything of the build itself, 2007-03-07) 3. bb2300976ba (Documentation/Makefile: make most operations "quiet", 2009-03-27) Signed-off-by: Ævar Arnfjörð Bjarmason --- git-gui/Makefile | 2 +- shared.mak | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/git-gui/Makefile b/git-gui/Makefile index 56c85a85c1e..a0d5a4b28e1 100644 --- a/git-gui/Makefile +++ b/git-gui/Makefile @@ -116,7 +116,7 @@ ifeq ($(uname_S),Darwin) TKEXECUTABLE = $(shell basename "$(TKFRAMEWORK)" .app) endif -ifeq ($(findstring $(MAKEFLAGS),s),s) +ifeq ($(findstring $(firstword -$(MAKEFLAGS)),s),s) QUIET_GEN = endif diff --git a/shared.mak b/shared.mak index be1f30ff206..aeb80fc4d5a 100644 --- a/shared.mak +++ b/shared.mak @@ -37,13 +37,13 @@ space := $(empty) $(empty) QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir QUIET_SUBDIR1 = -ifneq ($(findstring w,$(MAKEFLAGS)),w) +ifneq ($(findstring w,$(firstword -$(MAKEFLAGS))),w) PRINT_DIR = --no-print-directory else # "make -w" NO_SUBDIR = : endif -ifneq ($(findstring s,$(MAKEFLAGS)),s) +ifneq ($(findstring s,$(firstword -$(MAKEFLAGS))),s) ifndef V ## common QUIET_SUBDIR0 = +@subdir=