2014-10-02 13:04:48

by Michal Marek

[permalink] [raw]
Subject: Re: [PATCH 3/3] kbuild: remove obj-n and lib-n handling

On 2014-09-09 12:26, Masahiro Yamada wrote:
> Kconfig never defines CONFIG_* as 'n'.
> Now obj-n is only used in firmware/Makefile and it can be
> replaced with obj-. No makefile uses lib-n.

BTW, there are a few more instances of *-n, none of which seem useful:

$ git --no-pager grep -e '[a-z]-n\>' -- '*Makefile*' '*Kbuild*'
Makefile: $(init-n) $(init-) \
Makefile: $(core-n) $(core-) $(drivers-n) $(drivers-) \
Makefile: $(net-n) $(net-) $(libs-n) $(libs-))))
arch/arm/mach-ixp4xx/Makefile:obj-pci-n :=
arch/powerpc/boot/Makefile:initrd- := $(patsubst zImage%,
zImage.initrd%, $(image-n) $(image-))

Michal


2014-10-02 13:18:17

by Masahiro Yamada

[permalink] [raw]
Subject: Re: [PATCH 3/3] kbuild: remove obj-n and lib-n handling

Hi Michal,


On Thu, 02 Oct 2014 15:04:44 +0200
Michal Marek <[email protected]> wrote:

> On 2014-09-09 12:26, Masahiro Yamada wrote:
> > Kconfig never defines CONFIG_* as 'n'.
> > Now obj-n is only used in firmware/Makefile and it can be
> > replaced with obj-. No makefile uses lib-n.
>
> BTW, there are a few more instances of *-n, none of which seem useful:
>
> $ git --no-pager grep -e '[a-z]-n\>' -- '*Makefile*' '*Kbuild*'
> Makefile: $(init-n) $(init-) \
> Makefile: $(core-n) $(core-) $(drivers-n) $(drivers-) \
> Makefile: $(net-n) $(net-) $(libs-n) $(libs-))))
> arch/arm/mach-ixp4xx/Makefile:obj-pci-n :=
> arch/powerpc/boot/Makefile:initrd- := $(patsubst zImage%,
> zImage.initrd%, $(image-n) $(image-))

Uh, I missed them.

Anyway, it should be done in a separate patch
even if we fix them.

Can you fix them, please?
(I do not want to steal what you found.)

Simpler makefiles seem better.



Best Regards
Masahiro Yamada

2014-10-02 13:33:24

by Michal Marek

[permalink] [raw]
Subject: [PATCH] kbuild: Do not reference *-n variables in the Makefile

Kconfig options are either 'y', 'm', or undefined.

Signed-off-by: Michal Marek <[email protected]>
---
Makefile | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index efbd2cb..106f300 100644
--- a/Makefile
+++ b/Makefile
@@ -868,9 +868,7 @@ vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \
$(net-y) $(net-m) $(libs-y) $(libs-m)))

vmlinux-alldirs := $(sort $(vmlinux-dirs) $(patsubst %/,%,$(filter %/, \
- $(init-n) $(init-) \
- $(core-n) $(core-) $(drivers-n) $(drivers-) \
- $(net-n) $(net-) $(libs-n) $(libs-))))
+ $(init-) $(core-) $(drivers-) $(net-) $(libs-))))

init-y := $(patsubst %/, %/built-in.o, $(init-y))
core-y := $(patsubst %/, %/built-in.o, $(core-y))
--
1.8.4.5

2014-10-02 13:35:39

by Michal Marek

[permalink] [raw]
Subject: Re: [PATCH] kbuild: Do not reference *-n variables in the Makefile

On 2014-10-02 15:33, Michal Marek wrote:
> Kconfig options are either 'y', 'm', or undefined.
>
> Signed-off-by: Michal Marek <[email protected]>
> ---
> Makefile | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index efbd2cb..106f300 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -868,9 +868,7 @@ vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \
> $(net-y) $(net-m) $(libs-y) $(libs-m)))
>
> vmlinux-alldirs := $(sort $(vmlinux-dirs) $(patsubst %/,%,$(filter %/, \
> - $(init-n) $(init-) \
> - $(core-n) $(core-) $(drivers-n) $(drivers-) \
> - $(net-n) $(net-) $(libs-n) $(libs-))))
> + $(init-) $(core-) $(drivers-) $(net-) $(libs-))))

Actually, all the directories are hardcoded in
{init,code,drivers,net,libs}-y; there are currently no Kconfig variables
involved. But let's keep this generic and handle *-m and *- just in case.

Michal

2014-10-02 13:55:28

by Masahiro Yamada

[permalink] [raw]
Subject: Re: [PATCH] kbuild: Do not reference *-n variables in the Makefile

Hi Michal,

On Thu, 02 Oct 2014 15:35:35 +0200
Michal Marek <[email protected]> wrote:

> On 2014-10-02 15:33, Michal Marek wrote:
> > Kconfig options are either 'y', 'm', or undefined.
> >
> > Signed-off-by: Michal Marek <[email protected]>
> > ---
> > Makefile | 4 +---
> > 1 file changed, 1 insertion(+), 3 deletions(-)
> >
> > diff --git a/Makefile b/Makefile
> > index efbd2cb..106f300 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -868,9 +868,7 @@ vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \
> > $(net-y) $(net-m) $(libs-y) $(libs-m)))
> >
> > vmlinux-alldirs := $(sort $(vmlinux-dirs) $(patsubst %/,%,$(filter %/, \
> > - $(init-n) $(init-) \
> > - $(core-n) $(core-) $(drivers-n) $(drivers-) \
> > - $(net-n) $(net-) $(libs-n) $(libs-))))
> > + $(init-) $(core-) $(drivers-) $(net-) $(libs-))))
>
> Actually, all the directories are hardcoded in
> {init,code,drivers,net,libs}-y; there are currently no Kconfig variables
> involved. But let's keep this generic and handle *-m and *- just in case.
>

Agreed and thank you!

Best Regards
Masahiro Yamada