Re: [PATCH 1/5] kbuild: remove unnecessary $(subst $(obj)/,,...) in modname-multi

2018-03-08 Thread Masahiro Yamada
2018-03-08 10:04 GMT+09:00 Masahiro Yamada :
> In the context ...
>
> $(obj)/%.s: $(src)/%.c FORCE
> $(call if_changed_dep,cc_s_c)
>
> $(obj)/%.i: $(src)/%.c FORCE
> $(call if_changed_dep,cpp_i_c)
>
> $(obj)/%.o: $(src)/%.c $(recordmcount_source) $(objtool_dep) FORCE
> $(call cmd,force_checksrc)
> $(call if_changed_rule,cc_o_c)
>
> $(obj)/%.lst: $(src)/%.c FORCE
> $(call if_changed_dep,cc_lst_c)
>
> '$*' returns the stem of the target (the part of '%'), so $(obj)/ has
> already been ripped off.
>
> $(subst $(obj)/,,$*.o) is the same as $(*.o)


Log fix-up:

 ... is the same as $*.o





> Signed-off-by: Masahiro Yamada 
> ---
>
>  scripts/Makefile.lib | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index 5589bae..a7e315f 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -175,7 +175,7 @@ dtc_cpp_flags  = -Wp,-MD,$(depfile).pre.tmp -nostdinc 
>\
>
>  # Finds the multi-part object the current object will be linked into
>  modname-multi = $(sort $(foreach m,$(multi-used),\
> -   $(if $(filter $(subst $(obj)/,,$*.o), $($(m:.o=-objs)) 
> $($(m:.o=-y))),$(m:.o=
> +   $(if $(filter $*.o, $($(m:.o=-objs)) 
> $($(m:.o=-y))),$(m:.o=
>
>  # Useful for describing the dependency of composite objects
>  # Usage:
> --
> 2.7.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Best Regards
Masahiro Yamada


Re: [PATCH 1/5] kbuild: remove unnecessary $(subst $(obj)/,,...) in modname-multi

2018-03-08 Thread Masahiro Yamada
2018-03-08 10:04 GMT+09:00 Masahiro Yamada :
> In the context ...
>
> $(obj)/%.s: $(src)/%.c FORCE
> $(call if_changed_dep,cc_s_c)
>
> $(obj)/%.i: $(src)/%.c FORCE
> $(call if_changed_dep,cpp_i_c)
>
> $(obj)/%.o: $(src)/%.c $(recordmcount_source) $(objtool_dep) FORCE
> $(call cmd,force_checksrc)
> $(call if_changed_rule,cc_o_c)
>
> $(obj)/%.lst: $(src)/%.c FORCE
> $(call if_changed_dep,cc_lst_c)
>
> '$*' returns the stem of the target (the part of '%'), so $(obj)/ has
> already been ripped off.
>
> $(subst $(obj)/,,$*.o) is the same as $(*.o)


Log fix-up:

 ... is the same as $*.o





> Signed-off-by: Masahiro Yamada 
> ---
>
>  scripts/Makefile.lib | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index 5589bae..a7e315f 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -175,7 +175,7 @@ dtc_cpp_flags  = -Wp,-MD,$(depfile).pre.tmp -nostdinc 
>\
>
>  # Finds the multi-part object the current object will be linked into
>  modname-multi = $(sort $(foreach m,$(multi-used),\
> -   $(if $(filter $(subst $(obj)/,,$*.o), $($(m:.o=-objs)) 
> $($(m:.o=-y))),$(m:.o=
> +   $(if $(filter $*.o, $($(m:.o=-objs)) 
> $($(m:.o=-y))),$(m:.o=
>
>  # Useful for describing the dependency of composite objects
>  # Usage:
> --
> 2.7.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Best Regards
Masahiro Yamada


Re: [PATCH 1/5] kbuild: remove unnecessary $(subst $(obj)/,,...) in modname-multi

2018-03-08 Thread Cao jin


On 03/08/2018 09:04 AM, Masahiro Yamada wrote:
> In the context ...
> 
> $(obj)/%.s: $(src)/%.c FORCE
> $(call if_changed_dep,cc_s_c)
> 
> $(obj)/%.i: $(src)/%.c FORCE
> $(call if_changed_dep,cpp_i_c)
> 
> $(obj)/%.o: $(src)/%.c $(recordmcount_source) $(objtool_dep) FORCE
> $(call cmd,force_checksrc)
> $(call if_changed_rule,cc_o_c)
> 
> $(obj)/%.lst: $(src)/%.c FORCE
> $(call if_changed_dep,cc_lst_c)
> 
> '$*' returns the stem of the target (the part of '%'), so $(obj)/ has
> already been ripped off.
> 
> $(subst $(obj)/,,$*.o) is the same as $(*.o)
> 
> Signed-off-by: Masahiro Yamada 
> ---
> 
>  scripts/Makefile.lib | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index 5589bae..a7e315f 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -175,7 +175,7 @@ dtc_cpp_flags  = -Wp,-MD,$(depfile).pre.tmp -nostdinc 
>\
>  
>  # Finds the multi-part object the current object will be linked into
>  modname-multi = $(sort $(foreach m,$(multi-used),\
> - $(if $(filter $(subst $(obj)/,,$*.o), $($(m:.o=-objs)) 
> $($(m:.o=-y))),$(m:.o=
> + $(if $(filter $*.o, $($(m:.o=-objs)) $($(m:.o=-y))),$(m:.o=
>  
>  # Useful for describing the dependency of composite objects
>  # Usage:
> 

A subtle catch! And in my test, a debug line

    $(info $@ = $*)

in rule:

    $(obj)/%.o: $(src)/%.c xxx

does tell me it is correct. So,

Reviewed-by: Cao jin 
-- 
Sincerely,
Cao jin




Re: [PATCH 1/5] kbuild: remove unnecessary $(subst $(obj)/,,...) in modname-multi

2018-03-08 Thread Cao jin


On 03/08/2018 09:04 AM, Masahiro Yamada wrote:
> In the context ...
> 
> $(obj)/%.s: $(src)/%.c FORCE
> $(call if_changed_dep,cc_s_c)
> 
> $(obj)/%.i: $(src)/%.c FORCE
> $(call if_changed_dep,cpp_i_c)
> 
> $(obj)/%.o: $(src)/%.c $(recordmcount_source) $(objtool_dep) FORCE
> $(call cmd,force_checksrc)
> $(call if_changed_rule,cc_o_c)
> 
> $(obj)/%.lst: $(src)/%.c FORCE
> $(call if_changed_dep,cc_lst_c)
> 
> '$*' returns the stem of the target (the part of '%'), so $(obj)/ has
> already been ripped off.
> 
> $(subst $(obj)/,,$*.o) is the same as $(*.o)
> 
> Signed-off-by: Masahiro Yamada 
> ---
> 
>  scripts/Makefile.lib | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index 5589bae..a7e315f 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -175,7 +175,7 @@ dtc_cpp_flags  = -Wp,-MD,$(depfile).pre.tmp -nostdinc 
>\
>  
>  # Finds the multi-part object the current object will be linked into
>  modname-multi = $(sort $(foreach m,$(multi-used),\
> - $(if $(filter $(subst $(obj)/,,$*.o), $($(m:.o=-objs)) 
> $($(m:.o=-y))),$(m:.o=
> + $(if $(filter $*.o, $($(m:.o=-objs)) $($(m:.o=-y))),$(m:.o=
>  
>  # Useful for describing the dependency of composite objects
>  # Usage:
> 

A subtle catch! And in my test, a debug line

    $(info $@ = $*)

in rule:

    $(obj)/%.o: $(src)/%.c xxx

does tell me it is correct. So,

Reviewed-by: Cao jin 
-- 
Sincerely,
Cao jin




[PATCH 1/5] kbuild: remove unnecessary $(subst $(obj)/,,...) in modname-multi

2018-03-07 Thread Masahiro Yamada
In the context ...

$(obj)/%.s: $(src)/%.c FORCE
$(call if_changed_dep,cc_s_c)

$(obj)/%.i: $(src)/%.c FORCE
$(call if_changed_dep,cpp_i_c)

$(obj)/%.o: $(src)/%.c $(recordmcount_source) $(objtool_dep) FORCE
$(call cmd,force_checksrc)
$(call if_changed_rule,cc_o_c)

$(obj)/%.lst: $(src)/%.c FORCE
$(call if_changed_dep,cc_lst_c)

'$*' returns the stem of the target (the part of '%'), so $(obj)/ has
already been ripped off.

$(subst $(obj)/,,$*.o) is the same as $(*.o)

Signed-off-by: Masahiro Yamada 
---

 scripts/Makefile.lib | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 5589bae..a7e315f 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -175,7 +175,7 @@ dtc_cpp_flags  = -Wp,-MD,$(depfile).pre.tmp -nostdinc   
 \
 
 # Finds the multi-part object the current object will be linked into
 modname-multi = $(sort $(foreach m,$(multi-used),\
-   $(if $(filter $(subst $(obj)/,,$*.o), $($(m:.o=-objs)) 
$($(m:.o=-y))),$(m:.o=
+   $(if $(filter $*.o, $($(m:.o=-objs)) $($(m:.o=-y))),$(m:.o=
 
 # Useful for describing the dependency of composite objects
 # Usage:
-- 
2.7.4



[PATCH 1/5] kbuild: remove unnecessary $(subst $(obj)/,,...) in modname-multi

2018-03-07 Thread Masahiro Yamada
In the context ...

$(obj)/%.s: $(src)/%.c FORCE
$(call if_changed_dep,cc_s_c)

$(obj)/%.i: $(src)/%.c FORCE
$(call if_changed_dep,cpp_i_c)

$(obj)/%.o: $(src)/%.c $(recordmcount_source) $(objtool_dep) FORCE
$(call cmd,force_checksrc)
$(call if_changed_rule,cc_o_c)

$(obj)/%.lst: $(src)/%.c FORCE
$(call if_changed_dep,cc_lst_c)

'$*' returns the stem of the target (the part of '%'), so $(obj)/ has
already been ripped off.

$(subst $(obj)/,,$*.o) is the same as $(*.o)

Signed-off-by: Masahiro Yamada 
---

 scripts/Makefile.lib | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 5589bae..a7e315f 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -175,7 +175,7 @@ dtc_cpp_flags  = -Wp,-MD,$(depfile).pre.tmp -nostdinc   
 \
 
 # Finds the multi-part object the current object will be linked into
 modname-multi = $(sort $(foreach m,$(multi-used),\
-   $(if $(filter $(subst $(obj)/,,$*.o), $($(m:.o=-objs)) 
$($(m:.o=-y))),$(m:.o=
+   $(if $(filter $*.o, $($(m:.o=-objs)) $($(m:.o=-y))),$(m:.o=
 
 # Useful for describing the dependency of composite objects
 # Usage:
-- 
2.7.4