public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Schier <nicolas@fjasle.eu>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Tom Rix <trix@redhat.com>,
	llvm@lists.linux.dev
Subject: Re: [PATCH 1/2] kbuild: rename cmd_$@ to savedcmd_$@ in *.cmd files
Date: Thu, 29 Dec 2022 15:11:06 +0100	[thread overview]
Message-ID: <Y62f+iQdStrD4SIS@fjasle.eu> (raw)
In-Reply-To: <20221229091501.916296-1-masahiroy@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 1301 bytes --]

On Thu, Dec 29, 2022 at 06:15:00PM +0900 Masahiro Yamada wrote:
> The cmd-check macro compares $(cmd_$@) and $(cmd_$1), but a pitfall is
> that you cannot use cmd_<target> as the variable name for the command.
> 
> For example, the following code will not work in the top Makefile
> or ./Kbuild.
> 
>     quiet_cmd_foo = GEN     $@
>           cmd_foo = touch $@
> 
>     targets += foo
>     foo: FORCE
>             $(call if_changed,foo)
> 
> In this case, both $@ and $1 are expanded to 'foo', so $(cmd_check)
> is always empty.
> 
> We do not need to use the same prefix for cmd_$@ and cmd_$1.
> Rename the former to savedcmd_$@.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
> 
>  scripts/Kbuild.include                      | 8 ++++----
>  scripts/Makefile.modfinal                   | 2 +-
>  scripts/basic/fixdep.c                      | 4 ++--
>  scripts/clang-tools/gen_compile_commands.py | 2 +-
>  4 files changed, 8 insertions(+), 8 deletions(-)
> 

Thanks for fixing this, I wasn't aware of that at all.

Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>

-- 
epost|xmpp: nicolas@fjasle.eu          irc://oftc.net/nsc
↳ gpg: 18ed 52db e34f 860e e9fb  c82b 7d97 0932 55a0 ce7f
     -- frykten for herren er opphav til kunnskap --

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      parent reply	other threads:[~2022-12-29 14:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-29  9:15 [PATCH 1/2] kbuild: rename cmd_$@ to savedcmd_$@ in *.cmd files Masahiro Yamada
2022-12-29  9:15 ` [PATCH 2/2] kbuild: add more comments for KBUILD_NOCMDDEP=1 Masahiro Yamada
2022-12-29 14:11   ` Nicolas Schier
2022-12-29 14:11 ` Nicolas Schier [this message]

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=Y62f+iQdStrD4SIS@fjasle.eu \
    --to=nicolas@fjasle.eu \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=masahiroy@kernel.org \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=trix@redhat.com \
    /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