Skip to contentSkip to conversation

let kbuild mkdir for dir/file.o

PATCH New 张忠山 1 participant 1 message May 29, 2013 Kbuild

lore
Share & tools
lore

张忠山

author
#0 lore raw

PATCH 1/1 let kbuild mkdir for dir/file.o

when add a obj with dir to obj-y, like this

    obj-y += dir/file.o

the $(obj)/dir not created, this patch fix this

this bug caused by commit
f5fb976520a53f45f8bbf2e851f16b3b5558d485

---
 scripts/Makefile.lib |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
scripts/Makefile.lib +2 -1
index 51bb3de..6bae5a9 100644
@@ -63,7 +63,8 @@ multi-objs   := $(multi-objs-y) $(multi-objs-m)
 subdir-obj-y := $(filter %/built-in.o, $(obj-y))
 
 # $(obj-dirs) is a list of directories that contain object files
-obj-dirs := $(dir $(multi-objs) $(subdir-obj-y))
+__subdir-obj-y := $(foreach o,$(obj-y),$(if $(filter-out $(o),$(notdir $(o))),$(o)))
+obj-dirs := $(dir $(multi-objs) $(__subdir-obj-y))
 
 # Replace multi-part objects by their individual parts, look at local dir only
 real-objs-y := $(foreach m, $(filter-out $(subdir-obj-y), $(obj-y)), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) $(extra-y)
Signature · 1 line
1.7.9.5