diff mbox

let kbuild mkdir for dir/file.o

Message ID 1370335532-17891-2-git-send-email-zzs0213@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

zzs0213@gmail.com June 4, 2013, 8:45 a.m. UTC
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

Signed-off-by: ??? <zzs0213@gmail.com>
---
 scripts/Makefile.lib |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Michal Marek June 28, 2013, 10:44 p.m. UTC | #1
Hi,

sorry for the late feedback.

Dne 4.6.2013 10:45, ??? napsal(a):
> 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

Please also include the wonderful explanation including the error
message that you posted separately
(http://permalink.gmane.org/gmane.linux.kbuild.devel/10050). Also,
please CC linux-kernel in addition to linux-kbuild.


> 
> Signed-off-by: ??? <zzs0213@gmail.com>
> ---
>  scripts/Makefile.lib |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index 51bb3de..6bae5a9 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -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)))

This complicated filter returns entries from $(obj-y) that contain a
slash, is that correct? If so, is it really necessary? Why not simply
add whole $(obj-y) to $(obj-dirs) and be done? $(multi-objs) is also
added without any filtering.

> +obj-dirs := $(dir $(multi-objs) $(__subdir-obj-y))


thanks,
Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
zzs0213@gmail.com June 30, 2013, 9:02 a.m. UTC | #2
> >  # $(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)))
>
> This complicated filter returns entries from $(obj-y) that contain a
> slash, is that correct? If so, is it really necessary? Why not simply
> add whole $(obj-y) to $(obj-dirs) and be done? $(multi-objs) is also
> added without any filtering.
>
> > +obj-dirs := $(dir $(multi-objs) $(__subdir-obj-y))

Yes, You are right.
It is enough that just add $(obj-y) to $(obj-dirs) directly.
I will resend the patch.
diff mbox

Patch

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 51bb3de..6bae5a9 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -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)