2010-01-06 06:26:23

by Eric Miao

[permalink] [raw]
Subject: [PATCH] kbuild: include only necessary in scripts/Makefile.modbuiltin

commit aa7c411671269a75ed7adc0452851bf2cffd839e
Author: Eric Miao <[email protected]>
Date: Wed Jan 6 13:58:22 2010 +0800

kbuild: include only necessary in scripts/Makefile.modbuiltin

scripts/Makefile.modbuiltin assumes either Kbuild or Makefile exists in
every sub-directory, which is not true. Only include them when they are
existing.

Signed-off-by: Eric Miao <[email protected]>

diff --git a/scripts/Makefile.modbuiltin b/scripts/Makefile.modbuiltin
index 102a276..9148a70 100644
--- a/scripts/Makefile.modbuiltin
+++ b/scripts/Makefile.modbuiltin
@@ -17,7 +17,7 @@ include scripts/Kbuild.include
# The filename Kbuild has precedence over Makefile
kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
kbuild-file := $(if $(wildcard
$(kbuild-dir)/Kbuild),$(kbuild-dir)/Kbuild,$(kbuild-dir)/Makefile)
-include $(kbuild-file)
+-include $(kbuild-file)

include scripts/Makefile.lib
__subdir-Y := $(patsubst %/,%,$(filter %/, $(obj-Y)))


2010-01-06 09:52:10

by Michal Marek

[permalink] [raw]
Subject: Re: [PATCH] kbuild: include only necessary in scripts/Makefile.modbuiltin

On 6.1.2010 07:26, Eric Miao wrote:
> scripts/Makefile.modbuiltin assumes either Kbuild or Makefile exists in
> every sub-directory, which is not true.

It assumes what there is a kbuild file in each directory listed in
subdir-[ym] or obj-[ym]. For which directory is this not true? Did you
see an actual build failure? The same include is used in
scripts/Makefile.build, where it has been working fine for ages...

Michal

2010-01-06 10:32:29

by Eric Miao

[permalink] [raw]
Subject: Re: [PATCH] kbuild: include only necessary in scripts/Makefile.modbuiltin

On Wed, Jan 6, 2010 at 5:51 PM, Michal Marek <[email protected]> wrote:
> On 6.1.2010 07:26, Eric Miao wrote:
>> scripts/Makefile.modbuiltin assumes either Kbuild or Makefile exists in
>> every sub-directory, which is not true.
>
> It assumes what there is a kbuild file in each directory listed in
> subdir-[ym] or obj-[ym]. For which directory is this not true? Did you
> see an actual build failure? The same include is used in
> scripts/Makefile.build, where it has been working fine for ages...
>

Well, it's in my tree outside mainline, I have to make this change
to get it build. And'm wondering if that's a correct assumption.

2010-01-06 10:39:11

by Michal Marek

[permalink] [raw]
Subject: Re: [PATCH] kbuild: include only necessary in scripts/Makefile.modbuiltin

On 6.1.2010 11:31, Eric Miao wrote:
> On Wed, Jan 6, 2010 at 5:51 PM, Michal Marek <[email protected]> wrote:
>> On 6.1.2010 07:26, Eric Miao wrote:
>>> scripts/Makefile.modbuiltin assumes either Kbuild or Makefile exists in
>>> every sub-directory, which is not true.
>>
>> It assumes what there is a kbuild file in each directory listed in
>> subdir-[ym] or obj-[ym]. For which directory is this not true? Did you
>> see an actual build failure? The same include is used in
>> scripts/Makefile.build, where it has been working fine for ages...
>>
>
> Well, it's in my tree outside mainline, I have to make this change
> to get it build. And'm wondering if that's a correct assumption.

And scripts/Makefile.build does not fail? Strange. Can you point me at
the tree so that I can have a look? I assume it's some branch of
git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6.git.

Thanks,
Michal

2010-01-06 11:22:54

by Eric Miao

[permalink] [raw]
Subject: Re: [PATCH] kbuild: include only necessary in scripts/Makefile.modbuiltin

On Wed, Jan 6, 2010 at 6:39 PM, Michal Marek <[email protected]> wrote:
> On 6.1.2010 11:31, Eric Miao wrote:
>> On Wed, Jan 6, 2010 at 5:51 PM, Michal Marek <[email protected]> wrote:
>>> On 6.1.2010 07:26, Eric Miao wrote:
>>>> scripts/Makefile.modbuiltin assumes either Kbuild or Makefile exists in
>>>> every sub-directory, which is not true.
>>>
>>> It assumes what there is a kbuild file in each directory listed in
>>> subdir-[ym] or obj-[ym]. For which directory is this not true? Did you
>>> see an actual build failure? The same include is used in
>>> scripts/Makefile.build, where it has been working fine for ages...
>>>
>>
>> Well, it's in my tree outside mainline, I have to make this change
>> to get it build. And'm wondering if that's a correct assumption.
>
> And scripts/Makefile.build does not fail? Strange. Can you point me at
> the tree so that I can have a look? I assume it's some branch of
> git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6.git.
>

No, it's not within that tree.

And indeed it's strange - while scripts/Makefile.build doesn't fail since
there seems to be a script that generates some Makefiles in between
the build process, I'll get this figured out to see what is the root
cause.

> Thanks,
> Michal
>

2010-01-06 11:47:10

by Michal Marek

[permalink] [raw]
Subject: Re: [PATCH] kbuild: include only necessary in scripts/Makefile.modbuiltin

On 6.1.2010 12:22, Eric Miao wrote:
> And indeed it's strange - while scripts/Makefile.build doesn't fail since
> there seems to be a script that generates some Makefiles in between
> the build process, I'll get this figured out to see what is the root
> cause.

Oh. If that turns out to be the cause and the script is going to stay,
then the right fix would be to change the toplevel Makefile generate the
modules.builtin files in a separate target after the build, and not in
parallel. I planed to do this change anyway, to later avoid regenerating
the modules.builtin files if the config didn't change.

Michal

2010-01-06 12:00:10

by Eric Miao

[permalink] [raw]
Subject: Re: [PATCH] kbuild: include only necessary in scripts/Makefile.modbuiltin

On Wed, Jan 6, 2010 at 7:47 PM, Michal Marek <[email protected]> wrote:
> On 6.1.2010 12:22, Eric Miao wrote:
>> And indeed it's strange - while scripts/Makefile.build doesn't fail since
>> there seems to be a script that generates some Makefiles in between
>> the build process, I'll get this figured out to see what is the root
>> cause.
>
> Oh. If that turns out to be the cause and the script is going to stay,
> then the right fix would be to change the toplevel Makefile generate the
> modules.builtin files in a separate target after the build, and not in
> parallel. I planed to do this change anyway, to later avoid regenerating
> the modules.builtin files if the config didn't change.
>

That will be great, I'd be happy to give a test then.