History

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.

Masahiro Yamada committed 7 years ago

Commit 944cfe91 parent 5241ab41 file · +2 −4Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/Makefile.modpost+2−4
@@ -145,10 +145,8 @@ FORCE: · 144 unmodified lines
145# optimization, we don't need to read them if the target does not145# optimization, we don't need to read them if the target does not
146# exist, we will rebuild anyway in that case.146# exist, we will rebuild anyway in that case.
147 147
148cmd_files := $(wildcard $(foreach f,$(sort $(targets)),$(dir $(f)).$(notdir $(f)).cmd))148existing-targets := $(wildcard $(sort $(targets)))
149 149
150ifneq ($(cmd_files),)150-include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd)
151 include $(cmd_files)
152endif
153 151
154.PHONY: $(PHONY)152.PHONY: $(PHONY)