From 92215e7a801da7b89037a185c98f5ebb86a415b9 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Thu, 29 Dec 2022 18:15:00 +0900 Subject: kbuild: rename cmd_$@ to savedcmd_$@ in *.cmd files The cmd-check macro compares $(cmd_$@) and $(cmd_$1), but a pitfall is that you cannot use cmd_ 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 Reviewed-by: Nicolas Schier --- scripts/basic/fixdep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/basic') diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index f932aeaba71a..37782a632494 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c @@ -70,7 +70,7 @@ * * It first generates a line * - * cmd_ = + * savedcmd_ = * * and then basically copies the ..d file to stdout, in the * process filtering out the dependency on autoconf.h and adding @@ -343,7 +343,7 @@ int main(int argc, char *argv[]) target = argv[2]; cmdline = argv[3]; - printf("cmd_%s := %s\n\n", target, cmdline); + printf("savedcmd_%s := %s\n\n", target, cmdline); buf = read_file(depfile); parse_dep_file(buf, target); -- cgit