[RFC PATCH 1/2] scripts/kconfig/Makefile: Allow KBUILD_DEFCONFIG to be a target

2015-09-22 Thread Michael Ellerman
Arch Makefiles can set KBUILD_DEFCONFIG to tell kbuild the name of the
defconfig that should be built by default.

However currently there is an assumption that KBUILD_DEFCONFIG points to
a file at arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG).

We would like to use a target, using merge_config, as our defconfig, so
adapt the logic in scripts/kconfig/Makefile to allow that.

To minimise the chance of breaking anything, we first check if
KBUILD_DEFCONFIG is a file, and if so we do the old logic. If it's not a
file, then we call the top-level Makefile with KBUILD_DEFCONFIG as the
target.

Signed-off-by: Michael Ellerman 
---
 scripts/kconfig/Makefile | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index aceaaed09811..b2b9c87cec50 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -96,9 +96,12 @@ savedefconfig: $(obj)/conf
 defconfig: $(obj)/conf
 ifeq ($(KBUILD_DEFCONFIG),)
$< $(silent) --defconfig $(Kconfig)
-else
+else ifneq ($(wildcard arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)),)
@$(kecho) "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'"
$(Q)$< $(silent) 
--defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig)
+else
+   @$(kecho) "*** Default configuration is based on target 
'$(KBUILD_DEFCONFIG)'"
+   $(Q)$(MAKE) -f $(srctree)/Makefile $(KBUILD_DEFCONFIG)
 endif
 
 %_defconfig: $(obj)/conf
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC PATCH 1/2] scripts/kconfig/Makefile: Allow KBUILD_DEFCONFIG to be a target

2015-09-23 Thread Michal Marek
On 2015-09-23 07:40, Michael Ellerman wrote:
> +else ifneq ($(wildcard arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)),)
>   @$(kecho) "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'"
>   $(Q)$< $(silent) 
> --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig)
> +else
> + @$(kecho) "*** Default configuration is based on target 
> '$(KBUILD_DEFCONFIG)'"
> + $(Q)$(MAKE) -f $(srctree)/Makefile $(KBUILD_DEFCONFIG)
>  endif

What is the anticipated usage of this? The patch is not needed to make

  make ppc64le_defconfig

work with the second patch. If it was, this would create a loop anyway.

Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC PATCH 1/2] scripts/kconfig/Makefile: Allow KBUILD_DEFCONFIG to be a target

2015-09-30 Thread Michael Ellerman
On Fri, 2015-09-25 at 22:46 +0200, Michal Marek wrote:
> Dne 24.9.2015 v 00:16 Michael Ellerman napsal(a):
> > 
> > 
> > On 23 September 2015 19:50:52 GMT+10:00, Michal Marek
> >  wrote:
> >> On 2015-09-23 07:40, Michael Ellerman wrote:
> >>> +else ifneq ($(wildcard
> >> arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)),)
> >>> @$(kecho) "*** Default configuration is based on
> >> '$(KBUILD_DEFCONFIG)'"
> >>> $(Q)$< $(silent)
> >> --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig)
> >>> +else +   @$(kecho) "*** Default configuration is based on target
> >> '$(KBUILD_DEFCONFIG)'"
> >>> + $(Q)$(MAKE) -f $(srctree)/Makefile $(KBUILD_DEFCONFIG) endif
> >> 
> >> What is the anticipated usage of this? The patch is not needed to
> >> make
> >> 
> >> make ppc64le_defconfig
> >> 
> >> work with the second patch. If it was, this would create a loop
> >> anyway.
> > 
> > The idea is to make 'make defconfig' work when KBUILD_DEFCONFIG is
> > ppc64le_defconfig (which happens for us when uname returns ppc64le)
> > and additionally when ppc64le_defconfig is not a real file.
> 
> Ah, that makes sense. You can add
> 
> Acked-by: Michal Marek 
> 
> if you want.

Thanks. I'll assume by that you mean you're happy if I take both patches
through the powerpc tree.

cheers


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC PATCH 1/2] scripts/kconfig/Makefile: Allow KBUILD_DEFCONFIG to be a target

2015-09-30 Thread Michal Marek
On 2015-10-01 08:14, Michael Ellerman wrote:
> On Fri, 2015-09-25 at 22:46 +0200, Michal Marek wrote:
>> Dne 24.9.2015 v 00:16 Michael Ellerman napsal(a):
>>>
>>>
>>> On 23 September 2015 19:50:52 GMT+10:00, Michal Marek
>>>  wrote:
 On 2015-09-23 07:40, Michael Ellerman wrote:
> +else ifneq ($(wildcard
 arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)),)
> @$(kecho) "*** Default configuration is based on
 '$(KBUILD_DEFCONFIG)'"
> $(Q)$< $(silent)
 --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig)
> +else +   @$(kecho) "*** Default configuration is based on target
 '$(KBUILD_DEFCONFIG)'"
> + $(Q)$(MAKE) -f $(srctree)/Makefile $(KBUILD_DEFCONFIG) endif

 What is the anticipated usage of this? The patch is not needed to
 make

 make ppc64le_defconfig

 work with the second patch. If it was, this would create a loop
 anyway.
>>>
>>> The idea is to make 'make defconfig' work when KBUILD_DEFCONFIG is
>>> ppc64le_defconfig (which happens for us when uname returns ppc64le)
>>> and additionally when ppc64le_defconfig is not a real file.
>>
>> Ah, that makes sense. You can add
>>
>> Acked-by: Michal Marek 
>>
>> if you want.
> 
> Thanks. I'll assume by that you mean you're happy if I take both patches
> through the powerpc tree.

Yes, I assumed that this was your plan.

Michal

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC PATCH 1/2] scripts/kconfig/Makefile: Allow KBUILD_DEFCONFIG to be a target

2015-10-01 Thread Michael Ellerman
On Thu, 2015-10-01 at 08:50 +0200, Michal Marek wrote:
> On 2015-10-01 08:14, Michael Ellerman wrote:
> > On Fri, 2015-09-25 at 22:46 +0200, Michal Marek wrote:
> >> Dne 24.9.2015 v 00:16 Michael Ellerman napsal(a):
> >>> On 23 September 2015 19:50:52 GMT+10:00, Michal Marek
> >>>  wrote:
>  On 2015-09-23 07:40, Michael Ellerman wrote:
> > +else ifneq ($(wildcard
>  arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)),)
> > @$(kecho) "*** Default configuration is based on
>  '$(KBUILD_DEFCONFIG)'"
> > $(Q)$< $(silent)
>  --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig)
> > +else + @$(kecho) "*** Default configuration is based on target
>  '$(KBUILD_DEFCONFIG)'"
> > +   $(Q)$(MAKE) -f $(srctree)/Makefile $(KBUILD_DEFCONFIG) endif
> 
>  What is the anticipated usage of this? The patch is not needed to
>  make
> 
>  make ppc64le_defconfig
> 
>  work with the second patch. If it was, this would create a loop
>  anyway.
> >>>
> >>> The idea is to make 'make defconfig' work when KBUILD_DEFCONFIG is
> >>> ppc64le_defconfig (which happens for us when uname returns ppc64le)
> >>> and additionally when ppc64le_defconfig is not a real file.
> >>
> >> Ah, that makes sense. You can add
> >>
> >> Acked-by: Michal Marek 
> >>
> >> if you want.
> > 
> > Thanks. I'll assume by that you mean you're happy if I take both patches
> > through the powerpc tree.
> 
> Yes, I assumed that this was your plan.

I didn't really have a plan :)

It's certainly easiest if I take it in my tree along with the new
ppc64le_defconfig, so I'll do that. Thanks.

cheers


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC PATCH 1/2] scripts/kconfig/Makefile: Allow KBUILD_DEFCONFIG to be a target

2015-09-23 Thread Michael Ellerman


On 23 September 2015 19:50:52 GMT+10:00, Michal Marek  wrote:
>On 2015-09-23 07:40, Michael Ellerman wrote:
>> +else ifneq ($(wildcard
>arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)),)
>>  @$(kecho) "*** Default configuration is based on
>'$(KBUILD_DEFCONFIG)'"
>>  $(Q)$< $(silent)
>--defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig)
>> +else
>> +@$(kecho) "*** Default configuration is based on target
>'$(KBUILD_DEFCONFIG)'"
>> +$(Q)$(MAKE) -f $(srctree)/Makefile $(KBUILD_DEFCONFIG)
>>  endif
>
>What is the anticipated usage of this? The patch is not needed to make
>
>  make ppc64le_defconfig
>
>work with the second patch. If it was, this would create a loop anyway.

The idea is to make 'make defconfig' work when KBUILD_DEFCONFIG is 
ppc64le_defconfig (which happens for us when uname returns ppc64le) and 
additionally when ppc64le_defconfig is not a real file.

It doesn't work currently, but does with these two patches applied.

cheers

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC PATCH 1/2] scripts/kconfig/Makefile: Allow KBUILD_DEFCONFIG to be a target

2015-09-25 Thread Michal Marek
Dne 24.9.2015 v 00:16 Michael Ellerman napsal(a):
> 
> 
> On 23 September 2015 19:50:52 GMT+10:00, Michal Marek
>  wrote:
>> On 2015-09-23 07:40, Michael Ellerman wrote:
>>> +else ifneq ($(wildcard
>> arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)),)
>>> @$(kecho) "*** Default configuration is based on
>> '$(KBUILD_DEFCONFIG)'"
>>> $(Q)$< $(silent)
>> --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig)
>>> +else + @$(kecho) "*** Default configuration is based on target
>> '$(KBUILD_DEFCONFIG)'"
>>> +   $(Q)$(MAKE) -f $(srctree)/Makefile $(KBUILD_DEFCONFIG) endif
>> 
>> What is the anticipated usage of this? The patch is not needed to
>> make
>> 
>> make ppc64le_defconfig
>> 
>> work with the second patch. If it was, this would create a loop
>> anyway.
> 
> The idea is to make 'make defconfig' work when KBUILD_DEFCONFIG is
> ppc64le_defconfig (which happens for us when uname returns ppc64le)
> and additionally when ppc64le_defconfig is not a real file.

Ah, that makes sense. You can add

Acked-by: Michal Marek 

if you want.

Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/