diff mbox

[3/3] kbuild: remove obj-n and lib-n handling

Message ID 1410258381-7088-4-git-send-email-yamada.m@jp.panasonic.com (mailing list archive)
State New, archived
Headers show

Commit Message

Masahiro Yamada Sept. 9, 2014, 10:26 a.m. UTC
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.

Let's rip off obj-n and lib-n.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
---

 firmware/Makefile       | 2 +-
 scripts/Makefile.build  | 4 ++--
 scripts/Makefile.clean  | 4 +---
 scripts/Makefile.fwinst | 2 +-
 4 files changed, 5 insertions(+), 7 deletions(-)

Comments

Peter Foley Sept. 9, 2014, 4:20 p.m. UTC | #1
On Tue, Sep 9, 2014 at 6:26 AM, Masahiro Yamada
<yamada.m@jp.panasonic.com> 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.
>
> Let's rip off obj-n and lib-n.
>
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

Acked-by: Peter Foley <pefoley2@pefoley.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Michal Marek Oct. 2, 2014, 1:02 p.m. UTC | #2
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.

A possible usecase would be overriding CONFIG_ options on the commandline:

make CONFIG_FOOBAR=n

but CONFIG_FOOBAR= works as well.


> Let's rip off obj-n and lib-n.

Agreed, I applied your series to kbuild.git#kbuild now.

Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Michal Marek Oct. 2, 2014, 1:04 p.m. UTC | #3
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Masahiro Yamada Oct. 2, 2014, 1:17 p.m. UTC | #4
Hi Michal,


On Thu, 02 Oct 2014 15:04:44 +0200
Michal Marek <mmarek@suse.cz> 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

--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/firmware/Makefile b/firmware/Makefile
index 0862d34..e297e1b 100644
--- a/firmware/Makefile
+++ b/firmware/Makefile
@@ -232,6 +232,6 @@  targets := $(fw-shipped-) $(patsubst $(obj)/%,%, \
 
 # Without this, built-in.o won't be created when it's empty, and the
 # final vmlinux link will fail.
-obj-n := dummy
+obj- := dummy
 
 hostprogs-y := ihex2fw
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 5b09d36..649ce68 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -79,11 +79,11 @@  endif
 
 # ===========================================================================
 
-ifneq ($(strip $(lib-y) $(lib-m) $(lib-n) $(lib-)),)
+ifneq ($(strip $(lib-y) $(lib-m) $(lib-)),)
 lib-target := $(obj)/lib.a
 endif
 
-ifneq ($(strip $(obj-y) $(obj-m) $(obj-n) $(obj-) $(subdir-m) $(lib-target)),)
+ifneq ($(strip $(obj-y) $(obj-m) $(obj-) $(subdir-m) $(lib-target)),)
 builtin-target := $(obj)/built-in.o
 endif
 
diff --git a/scripts/Makefile.clean b/scripts/Makefile.clean
index a651cee..c630ab5 100644
--- a/scripts/Makefile.clean
+++ b/scripts/Makefile.clean
@@ -23,15 +23,13 @@  __subdir-y	:= $(patsubst %/,%,$(filter %/, $(obj-y)))
 subdir-y	+= $(__subdir-y)
 __subdir-m	:= $(patsubst %/,%,$(filter %/, $(obj-m)))
 subdir-m	+= $(__subdir-m)
-__subdir-n	:= $(patsubst %/,%,$(filter %/, $(obj-n)))
-subdir-n	+= $(__subdir-n)
 __subdir-	:= $(patsubst %/,%,$(filter %/, $(obj-)))
 subdir-		+= $(__subdir-)
 
 # Subdirectories we need to descend into
 
 subdir-ym	:= $(sort $(subdir-y) $(subdir-m))
-subdir-ymn      := $(sort $(subdir-ym) $(subdir-n) $(subdir-))
+subdir-ymn      := $(sort $(subdir-ym) $(subdir-))
 
 # Add subdir path
 
diff --git a/scripts/Makefile.fwinst b/scripts/Makefile.fwinst
index d8e335e..5b698ad 100644
--- a/scripts/Makefile.fwinst
+++ b/scripts/Makefile.fwinst
@@ -2,7 +2,7 @@ 
 # Installing firmware
 #
 # We don't include the .config, so all firmware files are in $(fw-shipped-)
-# rather than in $(fw-shipped-y) or $(fw-shipped-n).
+# rather than in $(fw-shipped-y) or $(fw-shipped-m).
 # ==========================================================================
 
 INSTALL := install