diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-12-31 03:24:09 -0500 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-01-05 19:46:51 -0500 |
commit | ad774086356da92a477a87916613d96f4b36005c (patch) | |
tree | 74ef11898c40507c5705d6980e856a250a4b089a /scripts | |
parent | 172caf1993b7a6503a9f7faf589e2cf26eb1f219 (diff) |
kbuild: change filechk to surround the given command with { }
filechk_* rules often consist of multiple 'echo' lines. They must be
surrounded with { } or ( ) to work correctly. Otherwise, only the
string from the last 'echo' would be written into the target.
Let's take care of that in the 'filechk' in scripts/Kbuild.include
to clean up filechk_* rules.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Kbuild.include | 2 | ||||
-rw-r--r-- | scripts/Makefile.lib | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index 46bf1a073f5d..74a3fe7ddc01 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include | |||
@@ -56,7 +56,7 @@ kecho := $($(quiet)kecho) | |||
56 | define filechk | 56 | define filechk |
57 | $(Q)set -e; \ | 57 | $(Q)set -e; \ |
58 | mkdir -p $(dir $@); \ | 58 | mkdir -p $(dir $@); \ |
59 | $(filechk_$(1)) > $@.tmp; \ | 59 | { $(filechk_$(1)); } > $@.tmp; \ |
60 | if [ -r $@ ] && cmp -s $@ $@.tmp; then \ | 60 | if [ -r $@ ] && cmp -s $@ $@.tmp; then \ |
61 | rm -f $@.tmp; \ | 61 | rm -f $@.tmp; \ |
62 | else \ | 62 | else \ |
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 390957f9306f..12b88d09c3a4 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
@@ -417,7 +417,6 @@ endef | |||
417 | # Use filechk to avoid rebuilds when a header changes, but the resulting file | 417 | # Use filechk to avoid rebuilds when a header changes, but the resulting file |
418 | # does not | 418 | # does not |
419 | define filechk_offsets | 419 | define filechk_offsets |
420 | ( \ | ||
421 | echo "#ifndef $2"; \ | 420 | echo "#ifndef $2"; \ |
422 | echo "#define $2"; \ | 421 | echo "#define $2"; \ |
423 | echo "/*"; \ | 422 | echo "/*"; \ |
@@ -428,5 +427,5 @@ define filechk_offsets | |||
428 | echo ""; \ | 427 | echo ""; \ |
429 | sed -ne $(sed-offsets) < $<; \ | 428 | sed -ne $(sed-offsets) < $<; \ |
430 | echo ""; \ | 429 | echo ""; \ |
431 | echo "#endif" ) | 430 | echo "#endif" |
432 | endef | 431 | endef |