All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kbuild: add %/built-in.o target in top Makefile
@ 2016-10-24 12:45 Wei Yang
  2016-11-01 15:53 ` Wei Yang
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Wei Yang @ 2016-10-24 12:45 UTC (permalink / raw)
  To: mmarek; +Cc: linux-kbuild, linux-kernel, Wei Yang

Current kbuild just supports building built-in.o in second directory level
individually. There is no rule to build those built-in.o targets below
third directory level.

Even current kbuild system could achieve this with rule "%/", while this
not only builds built-in targes but also lib target, extra target and
module objects.

This patch adds the "%/built-in.o" rule so that each built-in.o in the
kernel tree could be the build target, which looks more consistent for the
kbuild system.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
---
 Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Makefile b/Makefile
index addb235..546998e 100644
--- a/Makefile
+++ b/Makefile
@@ -1627,6 +1627,8 @@ endif
 	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
 %.symtypes: %.c prepare scripts FORCE
 	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
+%/built-in.o: prepare scripts
+	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
 
 # Modules
 /: prepare scripts FORCE
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] kbuild: add %/built-in.o target in top Makefile
  2016-10-24 12:45 [PATCH] kbuild: add %/built-in.o target in top Makefile Wei Yang
@ 2016-11-01 15:53 ` Wei Yang
  2016-11-01 16:27 ` Michal Marek
  2016-11-06 22:18 ` [PATCH V2] " Wei Yang
  2 siblings, 0 replies; 7+ messages in thread
From: Wei Yang @ 2016-11-01 15:53 UTC (permalink / raw)
  To: Wei Yang; +Cc: mmarek, linux-kbuild, linux-kernel

Hi, hope someone like this :-)

On Mon, Oct 24, 2016 at 12:45:11PM +0000, Wei Yang wrote:
>Current kbuild just supports building built-in.o in second directory level
>individually. There is no rule to build those built-in.o targets below
>third directory level.
>
>Even current kbuild system could achieve this with rule "%/", while this
>not only builds built-in targes but also lib target, extra target and
>module objects.
>
>This patch adds the "%/built-in.o" rule so that each built-in.o in the
>kernel tree could be the build target, which looks more consistent for the
>kbuild system.
>
>Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
>---
> Makefile | 2 ++
> 1 file changed, 2 insertions(+)
>
>diff --git a/Makefile b/Makefile
>index addb235..546998e 100644
>--- a/Makefile
>+++ b/Makefile
>@@ -1627,6 +1627,8 @@ endif
> 	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
> %.symtypes: %.c prepare scripts FORCE
> 	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
>+%/built-in.o: prepare scripts
>+	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
> 
> # Modules
> /: prepare scripts FORCE
>-- 
>2.5.0

-- 
Wei Yang
Help you, Help me

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] kbuild: add %/built-in.o target in top Makefile
  2016-10-24 12:45 [PATCH] kbuild: add %/built-in.o target in top Makefile Wei Yang
  2016-11-01 15:53 ` Wei Yang
@ 2016-11-01 16:27 ` Michal Marek
  2016-11-01 22:59   ` Wei Yang
  2016-11-06 22:18 ` [PATCH V2] " Wei Yang
  2 siblings, 1 reply; 7+ messages in thread
From: Michal Marek @ 2016-11-01 16:27 UTC (permalink / raw)
  To: Wei Yang; +Cc: linux-kbuild, linux-kernel

On 2016-10-24 14:45, Wei Yang wrote:

> diff --git a/Makefile b/Makefile
> index addb235..546998e 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1627,6 +1627,8 @@ endif
>  	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
>  %.symtypes: %.c prepare scripts FORCE
>  	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
> +%/built-in.o: prepare scripts
> +	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)

This rule gets in the way of

   975  # The actual objects are generated when descending,
   976  # make sure no implicit rule kicks in
   977  $(sort $(vmlinux-deps)): $(vmlinux-dirs) ;

Quickly looking at the Makefile, it may be fine, but it needs to be
confirmed. This also explains why the current behavior with */built-in.o
is inconsistent.

Michal

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] kbuild: add %/built-in.o target in top Makefile
  2016-11-01 16:27 ` Michal Marek
@ 2016-11-01 22:59   ` Wei Yang
  0 siblings, 0 replies; 7+ messages in thread
From: Wei Yang @ 2016-11-01 22:59 UTC (permalink / raw)
  To: Michal Marek; +Cc: Wei Yang, linux-kbuild, linux-kernel

On Tue, Nov 01, 2016 at 05:27:34PM +0100, Michal Marek wrote:
>On 2016-10-24 14:45, Wei Yang wrote:
>
>> diff --git a/Makefile b/Makefile
>> index addb235..546998e 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -1627,6 +1627,8 @@ endif
>>  	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
>>  %.symtypes: %.c prepare scripts FORCE
>>  	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
>> +%/built-in.o: prepare scripts
>> +	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
>
>This rule gets in the way of
>
>   975  # The actual objects are generated when descending,
>   976  # make sure no implicit rule kicks in
>   977  $(sort $(vmlinux-deps)): $(vmlinux-dirs) ;
>

Yes, second level built-in.o is built because of this rule, while for deeper
level built-in.o we don't have a rule now. This patch is trying to add a rule
for those deeper level built-in.o.

>Quickly looking at the Makefile, it may be fine, but it needs to be
>confirmed. This also explains why the current behavior with */built-in.o
>is inconsistent.
>

Agree with you. 

One of my concern is whether it is necessary to add "FORCE" to the prerequest.
I have tried on my machine, it works fine without "FORCE", while maybe it
won't work fine with some version of "make".

This is what I want to confirm. Any other potential issue, just let me know.

Thanks for your comment :-)

>Michal

-- 
Wei Yang
Help you, Help me

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH V2] kbuild: add %/built-in.o target in top Makefile
  2016-10-24 12:45 [PATCH] kbuild: add %/built-in.o target in top Makefile Wei Yang
  2016-11-01 15:53 ` Wei Yang
  2016-11-01 16:27 ` Michal Marek
@ 2016-11-06 22:18 ` Wei Yang
  2016-11-28 22:06   ` Wei Yang
  2017-02-22 14:20   ` Wei Yang
  2 siblings, 2 replies; 7+ messages in thread
From: Wei Yang @ 2016-11-06 22:18 UTC (permalink / raw)
  To: mmarek; +Cc: linux-kbuild, linux-kernel, Wei Yang

Current kbuild just supports building built-in.o in second directory level
individually. There is no rule to build those built-in.o targets below
third directory level.

Even current kbuild system could achieve this with rule "%/", while this
not only builds built-in targes but also lib target, extra target and
module objects.

This patch adds the "%/built-in.o" rule so that each built-in.o in the
kernel tree could be the build target, which looks more consistent for the
kbuild system.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>

---
v2
    . add FORCE in prerequest

---
 Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Makefile b/Makefile
index f97f786..9c65498 100644
--- a/Makefile
+++ b/Makefile
@@ -1638,6 +1638,8 @@ endif
 	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
 %.symtypes: %.c prepare scripts FORCE
 	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
+%/built-in.o: prepare scripts FORCE
+	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
 
 # Modules
 /: prepare scripts FORCE
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH V2] kbuild: add %/built-in.o target in top Makefile
  2016-11-06 22:18 ` [PATCH V2] " Wei Yang
@ 2016-11-28 22:06   ` Wei Yang
  2017-02-22 14:20   ` Wei Yang
  1 sibling, 0 replies; 7+ messages in thread
From: Wei Yang @ 2016-11-28 22:06 UTC (permalink / raw)
  To: Wei Yang; +Cc: mmarek, linux-kbuild, linux-kernel

Hi ~

On Sun, Nov 06, 2016 at 10:18:32PM +0000, Wei Yang wrote:
>Current kbuild just supports building built-in.o in second directory level
>individually. There is no rule to build those built-in.o targets below
>third directory level.
>
>Even current kbuild system could achieve this with rule "%/", while this
>not only builds built-in targes but also lib target, extra target and
>module objects.
>
>This patch adds the "%/built-in.o" rule so that each built-in.o in the
>kernel tree could be the build target, which looks more consistent for the
>kbuild system.
>
>Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
>
>---
>v2
>    . add FORCE in prerequest
>
>---
> Makefile | 2 ++
> 1 file changed, 2 insertions(+)
>
>diff --git a/Makefile b/Makefile
>index f97f786..9c65498 100644
>--- a/Makefile
>+++ b/Makefile
>@@ -1638,6 +1638,8 @@ endif
> 	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
> %.symtypes: %.c prepare scripts FORCE
> 	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
>+%/built-in.o: prepare scripts FORCE
>+	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
> 
> # Modules
> /: prepare scripts FORCE
>-- 
>2.5.0

-- 
Wei Yang
Help you, Help me

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH V2] kbuild: add %/built-in.o target in top Makefile
  2016-11-06 22:18 ` [PATCH V2] " Wei Yang
  2016-11-28 22:06   ` Wei Yang
@ 2017-02-22 14:20   ` Wei Yang
  1 sibling, 0 replies; 7+ messages in thread
From: Wei Yang @ 2017-02-22 14:20 UTC (permalink / raw)
  To: Wei Yang; +Cc: mmarek, linux-kbuild, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1330 bytes --]

Hi, haven't get any feedback for a looong time.

Someone would like this change ? :-)

On Sun, Nov 06, 2016 at 10:18:32PM +0000, Wei Yang wrote:
>Current kbuild just supports building built-in.o in second directory level
>individually. There is no rule to build those built-in.o targets below
>third directory level.
>
>Even current kbuild system could achieve this with rule "%/", while this
>not only builds built-in targes but also lib target, extra target and
>module objects.
>
>This patch adds the "%/built-in.o" rule so that each built-in.o in the
>kernel tree could be the build target, which looks more consistent for the
>kbuild system.
>
>Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
>
>---
>v2
>    . add FORCE in prerequest
>
>---
> Makefile | 2 ++
> 1 file changed, 2 insertions(+)
>
>diff --git a/Makefile b/Makefile
>index f97f786..9c65498 100644
>--- a/Makefile
>+++ b/Makefile
>@@ -1638,6 +1638,8 @@ endif
> 	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
> %.symtypes: %.c prepare scripts FORCE
> 	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
>+%/built-in.o: prepare scripts FORCE
>+	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
> 
> # Modules
> /: prepare scripts FORCE
>-- 
>2.5.0

-- 
Wei Yang
Help you, Help me

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-02-22 14:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-24 12:45 [PATCH] kbuild: add %/built-in.o target in top Makefile Wei Yang
2016-11-01 15:53 ` Wei Yang
2016-11-01 16:27 ` Michal Marek
2016-11-01 22:59   ` Wei Yang
2016-11-06 22:18 ` [PATCH V2] " Wei Yang
2016-11-28 22:06   ` Wei Yang
2017-02-22 14:20   ` Wei Yang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.