summaryrefslogtreecommitdiff
path: root/scripts/Makefile.build
diff options
context:
space:
mode:
authorIlias Apalodimas <[email protected]>2025-05-20 08:21:22 +0300
committerTom Rini <[email protected]>2025-05-29 18:42:37 -0600
commitcc571e29a8ecbba909cbb04ba062db026f70ae8b (patch)
treeeaf0dc53ae3aefbbeeaa9620865f5fde8c6c8340 /scripts/Makefile.build
parent47a4770c7a2f6dab7ada9ba77b12bd41939db551 (diff)
kbuild: let fixdep directly write to .*.cmd files
Backport from kernel commit 392885ee82d3 ("kbuild: let fixdep directly write to .*.cmd files") Signed-off-by: Ilias Apalodimas <[email protected]>
Diffstat (limited to 'scripts/Makefile.build')
-rw-r--r--scripts/Makefile.build11
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index d90b0b7aa6a..2f2d5d4afc2 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -410,14 +410,17 @@ 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)
# Create directories for object files if they do not exist
obj-dirs := $(sort $(obj) $(patsubst %/,%, $(dir $(targets))))
+# If targets exist, their directories apparently exist. Skip mkdir.
+existing-dirs := $(sort $(patsubst %/,%, $(dir $(existing-targets))))
+obj-dirs := $(strip $(filter-out $(existing-dirs), $(obj-dirs)))
+ifneq ($(obj-dirs),)
$(shell mkdir -p $(obj-dirs))
+endif
.PHONY: $(PHONY)