Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp978620iob; Fri, 13 May 2022 18:23:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8TPV4tgbn2ep2clRx3P+NPq9FQ0TnC4yBQiAbEYqpTOD6I3mKJWI7VMiA735Jy7EHvd6T X-Received: by 2002:a05:600c:34d4:b0:394:91a8:104b with SMTP id d20-20020a05600c34d400b0039491a8104bmr17081902wmq.134.1652491405618; Fri, 13 May 2022 18:23:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652491405; cv=none; d=google.com; s=arc-20160816; b=rO06BF7nSJvEB9cIlmzBjhXgfYdbjP7BE3ILYrZxBMVShL56IiSH/Z6yMhFkXHy6X5 E28RHYIKawMaLxF18FUETP1mT2B2wHsyIXeFEJEcfSAZbWUeHkRl/BIzWEQfEWERx/Ir 9fajQshrbigvqqHtszS9JpqfeT+Vig8Kq3f2nbRM5S+ZAnldEBt+0wTUrDrBI6CiKGzG 446NH2pnkAwEDMSpS85Q0qKf2ngZ5LwRTCP48JVLJvYxl8U5kvMTA/QqOdI17eiqDkbK ExAJ2ETdUjXZJZUIiiSsfPNEOa3nLqiFoQEpc2nCngbmjWZ0Sh91kHFIe5CYaFiUYXna zl7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=4NnWce4quhzN+ruCE0HHv7XtEXsZ+MV+fd85HOKaXsY=; b=MElcwH7ZOueZiBQUhRfO2cKMlL+8s62t8aUqy9fyPIDJoSvSNShFgZpdNYq02jVHa2 iDVG3kPXY98JImjx4vTofmDIxAMRVzdCSNusHby0IDjjb5gfoHkIJI2pmvDHC9lr/1wb zPiSYwVi0DTRx/cMI7PP8X1GAkpnyoXMRjCQHizZRFrMGWS6oyrK3FUG3QDVNnrSvfCN ZIyHEl/lhaxh0XaE4UnEfu6moeIBw0abol1oZ1Ku7xaUWptMEpX02gG5BUgJyCpc7RKZ mmFaFeCL9oCERcNGAzP5uzdVvDQUZnpFOpFaujf14Kc7G1/h2RnL7BZS5ypdrGV3RNWl oYQA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=fjasle.eu Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id n11-20020a5d484b000000b0020ad9d1f5dbsi3380663wrs.252.2022.05.13.18.23.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 18:23:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=fjasle.eu Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B2C1F3D3054; Fri, 13 May 2022 16:52:42 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379910AbiEMLke (ORCPT + 99 others); Fri, 13 May 2022 07:40:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241951AbiEMLka (ORCPT ); Fri, 13 May 2022 07:40:30 -0400 Received: from mail.avm.de (mail.avm.de [IPv6:2001:bf0:244:244::120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B59152B9CBB; Fri, 13 May 2022 04:40:26 -0700 (PDT) Received: from mail-auth.avm.de (unknown [IPv6:2001:bf0:244:244::71]) by mail.avm.de (Postfix) with ESMTPS; Fri, 13 May 2022 13:40:21 +0200 (CEST) Received: from buildd.core.avm.de (buildd-sv-01.avm.de [172.16.0.225]) by mail-auth.avm.de (Postfix) with ESMTPA id 1B42A81D50; Fri, 13 May 2022 13:40:22 +0200 (CEST) Received: by buildd.core.avm.de (Postfix, from userid 1000) id 10653182996; Fri, 13 May 2022 13:40:22 +0200 (CEST) Date: Fri, 13 May 2022 13:40:22 +0200 From: Nicolas Schier To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Nathan Chancellor , Nick Desaulniers , Peter Zijlstra , linux-modules@vger.kernel.org, llvm@lists.linux.dev, Ard Biesheuvel , Sami Tolvanen , Kees Cook Subject: Re: [PATCH v5 11/12] kbuild: add cmd_and_savecmd macro Message-ID: References: <20220511164514.2741934-1-masahiroy@kernel.org> <20220511164514.2741934-12-masahiroy@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220511164514.2741934-12-masahiroy@kernel.org> X-purgate-ID: 149429::1652442021-000003AF-7723183B/0/0 X-purgate-type: clean X-purgate-size: 1806 X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 12, 2022 at 01:45:13AM +0900, Masahiro Yamada wrote: > Separate out the command execution part of if_changed, as we did > for if_changed_dep. > > This allows us to reuse it in if_changed_rule. > > define rule_foo > $(call cmd_and_savecmd,foo) > $(call cmd,bar) > endef > > Signed-off-by: Masahiro Yamada > Reviewed-by: Kees Cook > --- > > (no changes since v4) > > Changes in v4: > - New. > Resent of my previous submission. > https://lore.kernel.org/all/20210831074004.3195284-10-masahiroy@kernel.org/ > > scripts/Kbuild.include | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include > index 455a0a6ce12d..ece44b735061 100644 > --- a/scripts/Kbuild.include > +++ b/scripts/Kbuild.include > @@ -142,9 +142,11 @@ check-FORCE = $(if $(filter FORCE, $^),,$(warning FORCE prerequisite is missing) > if-changed-cond = $(newer-prereqs)$(cmd-check)$(check-FORCE) > > # Execute command if command has changed or prerequisite(s) are updated. > -if_changed = $(if $(if-changed-cond), \ > +if_changed = $(if $(if-changed-cond),$(cmd_and_savecmd),@:) > + > +cmd_and_savecmd = \ > $(cmd); \ > - printf '%s\n' 'cmd_$@ := $(make-cmd)' > $(dot-target).cmd, @:) > + printf '%s\n' 'cmd_$@ := $(make-cmd)' > $(dot-target).cmd > > # Execute the command and also postprocess generated .d dependencies file. > if_changed_dep = $(if $(if-changed-cond),$(cmd_and_fixdep),@:) > -- > 2.32.0 > Reviewed-by: Nicolas Schier