[PATCH] kbuild: add more hints about SUBDIRS replacement
From: Masahiro Yamada
Date: Tue Jun 25 2019 - 04:52:59 EST
Commit 0126be38d988 ("kbuild: announce removal of SUBDIRS if used")
added a hint about the 'SUBDIRS' replacement, but it was not clear
Multiple people sent me similar questions, patches.
I did not mean to suggest M= for building a subdirectory in the kernel
>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: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:221: If you are building an external module,
Makefile:222: Please use 'M=' or 'KBUILD_EXTMOD' instead
Suggested-by: Christoph Hellwig <hch@xxxxxx>
Signed-off-by: Masahiro Yamada <yamada.masahiro@xxxxxxxxxxxxx>
Makefile | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/Makefile b/Makefile
index 7a7c17eb0cbf..823a39d940c6 100644
@@ -212,6 +212,13 @@ endif
$(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)
KBUILD_EXTMOD ?= $(SUBDIRS)