[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y62f+iQdStrD4SIS@fjasle.eu>
Date: Thu, 29 Dec 2022 15:11:06 +0100
From: Nicolas Schier <nicolas@...sle.eu>
To: Masahiro Yamada <masahiroy@...nel.org>
Cc: linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Tom Rix <trix@...hat.com>, llvm@...ts.linux.dev
Subject: Re: [PATCH 1/2] kbuild: rename cmd_$@ to savedcmd_$@ in *.cmd files
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@...nel.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@...sle.eu>
--
epost|xmpp: nicolas@...sle.eu irc://oftc.net/nsc
↳ gpg: 18ed 52db e34f 860e e9fb c82b 7d97 0932 55a0 ce7f
-- frykten for herren er opphav til kunnskap --
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists