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. Commit392885ee82
("kbuild: let fixdep directly write to .*.cmd files") missed to fix up this file. Fixes:392885ee82
("kbuild: let fixdep directly write to .*.cmd") Cc: <stable@vger.kernel.org> # v5.0+ Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
This commit is contained in:
parent
5241ab4cf4
commit
944cfe9be1
|
@ -145,10 +145,8 @@ FORCE:
|
||||||
# optimization, we don't need to read them if the target does not
|
# optimization, we don't need to read them if the target does not
|
||||||
# exist, we will rebuild anyway in that case.
|
# 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 $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd)
|
||||||
include $(cmd_files)
|
|
||||||
endif
|
|
||||||
|
|
||||||
.PHONY: $(PHONY)
|
.PHONY: $(PHONY)
|
||||||
|
|
Loading…
Reference in New Issue