From: Masahiro Yamada Date: Tue, 30 Jul 2019 15:58:59 +0000 (+0900) Subject: kbuild: modpost: include .*.cmd files only when targets exist X-Git-Tag: v5.15~5765^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=944cfe9be1fbbec73bab2f7e77fe2e8f9c72970f;p=platform%2Fkernel%2Flinux-starfive.git 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: # v5.0+ Signed-off-by: Masahiro Yamada --- diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index 6b19c1a..ad4b982 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)