diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-07-30 17:58:59 +0200 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-07-31 17:09:49 +0200 |
commit | 944cfe9be1fbbec73bab2f7e77fe2e8f9c72970f (patch) | |
tree | b2dd7065dc2e0487eeda55a0bd0a795b07dc6e4d /scripts/Makefile.modpost | |
parent | kbuild: initialize CLANG_FLAGS correctly in the top Makefile (diff) | |
download | linux-944cfe9be1fbbec73bab2f7e77fe2e8f9c72970f.tar.xz linux-944cfe9be1fbbec73bab2f7e77fe2e8f9c72970f.zip |
kbuild: modpost: include .*.cmd files only when targets exist
If a build rule fails, the .DELETE_ON_ERROR special target removes the
target, but does nothing for the .*.cmd file, which might be corrupted.
So, .*.cmd files should be included only when the corresponding targets
exist.
Commit 392885ee82d3 ("kbuild: let fixdep directly write to .*.cmd
files") missed to fix up this file.
Fixes: 392885ee82d3 ("kbuild: let fixdep directly write to .*.cmd")
Cc: <stable@vger.kernel.org> # v5.0+
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'scripts/Makefile.modpost')
-rw-r--r-- | scripts/Makefile.modpost | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index 6b19c1a4eae5..ad4b9829a456 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -145,10 +145,8 @@ FORCE: # optimization, we don't need to read them if the target does not # exist, we will rebuild anyway in that case. -cmd_files := $(wildcard $(foreach f,$(sort $(targets)),$(dir $(f)).$(notdir $(f)).cmd)) +existing-targets := $(wildcard $(sort $(targets))) -ifneq ($(cmd_files),) - include $(cmd_files) -endif +-include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd) .PHONY: $(PHONY) |