All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kbuild: add more hints about SUBDIRS replacement
@ 2019-06-25  8:51 Masahiro Yamada
  2019-06-26 14:30 ` Sam Ravnborg
  0 siblings, 1 reply; 3+ messages in thread
From: Masahiro Yamada @ 2019-06-25  8:51 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Christoph Hellwig, Herbert Xu, Sam Ravnborg, Xi Wang,
	Masahiro Yamada, Michal Marek, linux-kernel

Commit 0126be38d988 ("kbuild: announce removal of SUBDIRS if used")
added a hint about the 'SUBDIRS' replacement, but it was not clear
enough.

Multiple people sent me similar questions, patches.

  https://lkml.org/lkml/2019/1/17/456

I did not mean to suggest M= for building a subdirectory in the kernel
tree.

From the commit 669efc76b317 ("net: hns3: fix compile error"), people
already (ab)use M=... to do that because it seems to work to some extent.

Documentation/kbuild/kbuild.txt says M= and KBUILD_EXTMOD are used for
building external modules.

In fact, Kbuild supports the single target '%/' for this purpose, but
this may not be noticed much.

Kindly add more hints.

Makefile:213: ================= WARNING ================
Makefile:214: 'SUBDIRS' will be removed after Linux 5.3
Makefile:215:
Makefile:216: If you are building an individual subdirectory
Makefile:217: in the kernel tree, you can do like this:
Makefile:218: $ make path/to/dir/you/want/to/build/
Makefile:219: (Do not forget the trailing slash)
Makefile:220:
Makefile:221: If you are building an external module,
Makefile:222: Please use 'M=' or 'KBUILD_EXTMOD' instead
Makefile:223: ==========================================

Suggested-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 Makefile | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/Makefile b/Makefile
index 7a7c17eb0cbf..823a39d940c6 100644
--- a/Makefile
+++ b/Makefile
@@ -212,6 +212,13 @@ endif
 ifdef SUBDIRS
   $(warning ================= WARNING ================)
   $(warning 'SUBDIRS' will be removed after Linux 5.3)
+  $(warning )
+  $(warning If you are building an individual subdirectory)
+  $(warning in the kernel tree, you can do like this:)
+  $(warning $$ make path/to/dir/you/want/to/build/)
+  $(warning (Do not forget the trailing slash))
+  $(warning )
+  $(warning If you are building an external module,)
   $(warning Please use 'M=' or 'KBUILD_EXTMOD' instead)
   $(warning ==========================================)
   KBUILD_EXTMOD ?= $(SUBDIRS)
-- 
2.17.1


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

* Re: [PATCH] kbuild: add more hints about SUBDIRS replacement
  2019-06-25  8:51 [PATCH] kbuild: add more hints about SUBDIRS replacement Masahiro Yamada
@ 2019-06-26 14:30 ` Sam Ravnborg
  2019-07-06 14:30   ` Masahiro Yamada
  0 siblings, 1 reply; 3+ messages in thread
From: Sam Ravnborg @ 2019-06-26 14:30 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-kbuild, Christoph Hellwig, Herbert Xu, Xi Wang,
	Michal Marek, linux-kernel

On Tue, Jun 25, 2019 at 05:51:27PM +0900, Masahiro Yamada wrote:
> Commit 0126be38d988 ("kbuild: announce removal of SUBDIRS if used")
> added a hint about the 'SUBDIRS' replacement, but it was not clear
> enough.
> 
> Multiple people sent me similar questions, patches.
> 
>   https://lkml.org/lkml/2019/1/17/456
> 
> I did not mean to suggest M= for building a subdirectory in the kernel
> tree.
> 
> >From the commit 669efc76b317 ("net: hns3: fix compile error"), people
> already (ab)use M=... to do that because it seems to work to some extent.
> 
> Documentation/kbuild/kbuild.txt says M= and KBUILD_EXTMOD are used for
> building external modules.
> 
> In fact, Kbuild supports the single target '%/' for this purpose, but
> this may not be noticed much.
> 
> Kindly add more hints.
> 
> Makefile:213: ================= WARNING ================
> Makefile:214: 'SUBDIRS' will be removed after Linux 5.3
> Makefile:215:
> Makefile:216: If you are building an individual subdirectory
> Makefile:217: in the kernel tree, you can do like this:
> Makefile:218: $ make path/to/dir/you/want/to/build/
> Makefile:219: (Do not forget the trailing slash)
> Makefile:220:
> Makefile:221: If you are building an external module,
> Makefile:222: Please use 'M=' or 'KBUILD_EXTMOD' instead
> Makefile:223: ==========================================
> 
> Suggested-by: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Nice!

Acked-by: Sam Ravnborg <sam@ravnborg.org>

	Sam

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

* Re: [PATCH] kbuild: add more hints about SUBDIRS replacement
  2019-06-26 14:30 ` Sam Ravnborg
@ 2019-07-06 14:30   ` Masahiro Yamada
  0 siblings, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2019-07-06 14:30 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux Kbuild mailing list, Christoph Hellwig, Herbert Xu,
	Xi Wang, Michal Marek, Linux Kernel Mailing List

On Wed, Jun 26, 2019 at 11:30 PM Sam Ravnborg <sam@ravnborg.org> wrote:
>
> On Tue, Jun 25, 2019 at 05:51:27PM +0900, Masahiro Yamada wrote:
> > Commit 0126be38d988 ("kbuild: announce removal of SUBDIRS if used")
> > added a hint about the 'SUBDIRS' replacement, but it was not clear
> > enough.
> >
> > Multiple people sent me similar questions, patches.
> >
> >   https://lkml.org/lkml/2019/1/17/456
> >
> > I did not mean to suggest M= for building a subdirectory in the kernel
> > tree.
> >
> > >From the commit 669efc76b317 ("net: hns3: fix compile error"), people
> > already (ab)use M=... to do that because it seems to work to some extent.
> >
> > Documentation/kbuild/kbuild.txt says M= and KBUILD_EXTMOD are used for
> > building external modules.
> >
> > In fact, Kbuild supports the single target '%/' for this purpose, but
> > this may not be noticed much.
> >
> > Kindly add more hints.
> >
> > Makefile:213: ================= WARNING ================
> > Makefile:214: 'SUBDIRS' will be removed after Linux 5.3
> > Makefile:215:
> > Makefile:216: If you are building an individual subdirectory
> > Makefile:217: in the kernel tree, you can do like this:
> > Makefile:218: $ make path/to/dir/you/want/to/build/
> > Makefile:219: (Do not forget the trailing slash)
> > Makefile:220:
> > Makefile:221: If you are building an external module,
> > Makefile:222: Please use 'M=' or 'KBUILD_EXTMOD' instead
> > Makefile:223: ==========================================
> >
> > Suggested-by: Christoph Hellwig <hch@lst.de>
> > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>
> Nice!
>
> Acked-by: Sam Ravnborg <sam@ravnborg.org>
>
>         Sam

Applied to linux-kbuild.

-- 
Best Regards
Masahiro Yamada

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

end of thread, other threads:[~2019-07-06 14:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-25  8:51 [PATCH] kbuild: add more hints about SUBDIRS replacement Masahiro Yamada
2019-06-26 14:30 ` Sam Ravnborg
2019-07-06 14:30   ` Masahiro Yamada

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.