kbuild: replace $(dot-target).tmp in filechk with $(tmp-target)
PATCH 1/1 kbuild: replace $(dot-target).tmp in filechk with $(tmp-target)
$(tmp-target) is a better fit for local use like this.
Signed-off-by Masahiro Yamada <[email protected]>
---
scripts/Kbuild.include | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
scripts/Kbuild.include +4 -4
@@ -99,11 +99,11 @@ define filechk $(check-FORCE) $(Q)set -e; \ mkdir -p $(dir $@); \ - trap "rm -f $(dot-target).tmp" EXIT; \ - { $(filechk_$(1)); } > $(dot-target).tmp; \ - if [ ! -r $@ ] || ! cmp -s $@ $(dot-target).tmp; then \ + trap "rm -f $(tmp-target)" EXIT; \ + { $(filechk_$(1)); } > $(tmp-target); \ + if [ ! -r $@ ] || ! cmp -s $@ $(tmp-target); then \ $(kecho) ' UPD $@'; \ - mv -f $(dot-target).tmp $@; \ + mv -f $(tmp-target) $@; \ fi endef
Signature · 1 line
2.34.1
Quoted 30 lines · On Mon, Jan 09, 2023 at 10:40:40PM +0900 Masahiro Yamada wrote:
$(tmp-target) is a better fit for local use like this.
Signed-off-by Masahiro Yamada <[email protected]>---
scripts/Kbuild.include | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)scripts/Kbuild.include +4
-4@@ -99,11 +99,11 @@ define filechk $(check-FORCE) $(Q)set -e; \ mkdir -p $(dir $@); \ - trap "rm -f $(dot-target).tmp" EXIT; \ - { $(filechk_$(1)); } > $(dot-target).tmp; \ - if [ ! -r $@ ] || ! cmp -s $@ $(dot-target).tmp; then \ + trap "rm -f $(tmp-target)" EXIT; \ + { $(filechk_$(1)); } > $(tmp-target); \ + if [ ! -r $@ ] || ! cmp -s $@ $(tmp-target); then \ $(kecho) ' UPD $@'; \ - mv -f $(dot-target).tmp $@; \ + mv -f $(tmp-target) $@; \ fi endefSignature · 1 line
2.34.1
I do fully agree.
Reviewed-by Nicolas Schier <[email protected]>