Commit cc8a51ca authored by Masahiro Yamada's avatar Masahiro Yamada

kbuild: always create directories of targets

Currently, the directories of objects are automatically created
only for O= builds.

It should not hurt to cater to this for in-tree builds too.
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
parent 1bca5440
...@@ -515,15 +515,13 @@ existing-targets := $(wildcard $(sort $(targets))) ...@@ -515,15 +515,13 @@ existing-targets := $(wildcard $(sort $(targets)))
-include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd) -include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd)
ifdef building_out_of_srctree
# Create directories for object files if they do not exist # Create directories for object files if they do not exist
obj-dirs := $(sort $(obj) $(patsubst %/,%, $(dir $(targets)))) obj-dirs := $(sort $(patsubst %/,%, $(dir $(targets))))
# If targets exist, their directories apparently exist. Skip mkdir. # If targets exist, their directories apparently exist. Skip mkdir.
existing-dirs := $(sort $(patsubst %/,%, $(dir $(existing-targets)))) existing-dirs := $(sort $(patsubst %/,%, $(dir $(existing-targets))))
obj-dirs := $(strip $(filter-out $(existing-dirs), $(obj-dirs))) obj-dirs := $(strip $(filter-out $(existing-dirs), $(obj-dirs)))
ifneq ($(obj-dirs),) ifneq ($(obj-dirs),)
$(shell mkdir -p $(obj-dirs)) $(shell mkdir -p $(obj-dirs))
endif endif
endif
.PHONY: $(PHONY) .PHONY: $(PHONY)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment