diff mbox

[RFC] kbuild: improvement in Makefile.modbuiltin

Message ID 20171118112313.13557-1-caoj.fnst@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Cao jin Nov. 18, 2017, 11:23 a.m. UTC
Drop unnecessary "__subdir-Y" and `cat /dev/null`

Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
---
Don't know why they exist, but a simple build is fine without them
in my test

 scripts/Makefile.modbuiltin | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Cao jin Nov. 20, 2017, 11:50 a.m. UTC | #1
On 11/18/2017 07:23 PM, Cao jin wrote:
> Drop unnecessary "__subdir-Y" and `cat /dev/null`
> 
> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
> ---
> Don't know why they exist, but a simple build is fine without them
> in my test
> 
>  scripts/Makefile.modbuiltin | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/scripts/Makefile.modbuiltin b/scripts/Makefile.modbuiltin
> index a763b4775d06..cbb1e3dc1ef9 100644
> --- a/scripts/Makefile.modbuiltin
> +++ b/scripts/Makefile.modbuiltin
> @@ -26,8 +26,7 @@ kbuild-file := $(if $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Kbuild,$(kbui
>  include $(kbuild-file)
>  
>  include scripts/Makefile.lib
> -__subdir-Y     := $(patsubst %/,%,$(filter %/, $(obj-Y)))
> -subdir-Y       += $(__subdir-Y)
> +subdir-Y       := $(patsubst %/,%,$(filter %/, $(obj-Y)))
>  subdir-ym      := $(sort $(subdir-y) $(subdir-Y) $(subdir-m))
>  subdir-ym      := $(addprefix $(obj)/,$(subdir-ym))
>  obj-Y          := $(addprefix $(obj)/,$(obj-Y))
> @@ -41,7 +40,7 @@ __modbuiltin: $(modbuiltin-target) $(subdir-ym)
>  
>  $(modbuiltin-target): $(subdir-ym) FORCE
>  	$(Q)(for m in $(modbuiltin-mods); do echo kernel/$$m; done;	\
> -	cat /dev/null $(modbuiltin-subdirs)) > $@
> +	cat $(modbuiltin-subdirs)) > $@
>  

I take this patch back, this change does has something wrong in the
test. I guess I didn't test it in a pure clean source that day.

Sorry for the noise.

>  PHONY += FORCE
>  
>
diff mbox

Patch

diff --git a/scripts/Makefile.modbuiltin b/scripts/Makefile.modbuiltin
index a763b4775d06..cbb1e3dc1ef9 100644
--- a/scripts/Makefile.modbuiltin
+++ b/scripts/Makefile.modbuiltin
@@ -26,8 +26,7 @@  kbuild-file := $(if $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Kbuild,$(kbui
 include $(kbuild-file)
 
 include scripts/Makefile.lib
-__subdir-Y     := $(patsubst %/,%,$(filter %/, $(obj-Y)))
-subdir-Y       += $(__subdir-Y)
+subdir-Y       := $(patsubst %/,%,$(filter %/, $(obj-Y)))
 subdir-ym      := $(sort $(subdir-y) $(subdir-Y) $(subdir-m))
 subdir-ym      := $(addprefix $(obj)/,$(subdir-ym))
 obj-Y          := $(addprefix $(obj)/,$(obj-Y))
@@ -41,7 +40,7 @@  __modbuiltin: $(modbuiltin-target) $(subdir-ym)
 
 $(modbuiltin-target): $(subdir-ym) FORCE
 	$(Q)(for m in $(modbuiltin-mods); do echo kernel/$$m; done;	\
-	cat /dev/null $(modbuiltin-subdirs)) > $@
+	cat $(modbuiltin-subdirs)) > $@
 
 PHONY += FORCE