Skip to content

Commit 0126be3

Browse files
committed
kbuild: announce removal of SUBDIRS if used
SUBDIRS has been kept as a backward compatibility since commit ("[PATCH] kbuild: external module support") in 2002. We do not need multiple ways to do the same thing, so I will remove SUBDIRS after the Linux 5.3 release. I cleaned up in-tree code, and updated the document so that nobody would try to use it. Meanwhile, display the following warning if SUBDIRS is used. Makefile:189: ================= WARNING ================ Makefile:190: 'SUBDIRS' will be removed after Linux 5.3 Makefile:191: Please use 'M=' or 'KBUILD_EXTMOD' instead Makefile:192: ========================================== Signed-off-by: Masahiro Yamada <[email protected]> Acked-by: Boris Brezillon <[email protected]> # for scx200_docflash.c Acked-by: Guenter Roeck <[email protected]> # for scx200_wdt.c
1 parent 0987abc commit 0126be3

File tree

5 files changed

+6
-21
lines changed

5 files changed

+6
-21
lines changed

Documentation/kbuild/kbuild.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,7 @@ KBUILD_EXTMOD
8181
--------------------------------------------------
8282
Set the directory to look for the kernel source when building external
8383
modules.
84-
The directory can be specified in several ways:
85-
1) Use "M=..." on the command line
86-
2) Environment variable KBUILD_EXTMOD
87-
3) Environment variable SUBDIRS
88-
The possibilities are listed in the order they take precedence.
89-
Using "M=..." will always override the others.
84+
Setting "M=..." takes precedence over KBUILD_EXTMOD.
9085

9186
KBUILD_OUTPUT
9287
--------------------------------------------------

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,10 @@ endif
186186
# Old syntax make ... SUBDIRS=$PWD is still supported
187187
# Setting the environment variable KBUILD_EXTMOD take precedence
188188
ifdef SUBDIRS
189+
$(warning ================= WARNING ================)
190+
$(warning 'SUBDIRS' will be removed after Linux 5.3)
191+
$(warning Please use 'M=' or 'KBUILD_EXTMOD' instead)
192+
$(warning ==========================================)
189193
KBUILD_EXTMOD ?= $(SUBDIRS)
190194
endif
191195

drivers/mtd/maps/scx200_docflash.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,3 @@ static void __exit cleanup_scx200_docflash(void)
216216

217217
module_init(init_scx200_docflash);
218218
module_exit(cleanup_scx200_docflash);
219-
220-
/*
221-
Local variables:
222-
compile-command: "make -k -C ../../.. SUBDIRS=drivers/mtd/maps modules"
223-
c-basic-offset: 8
224-
End:
225-
*/

drivers/watchdog/scx200_wdt.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -262,10 +262,3 @@ static void __exit scx200_wdt_cleanup(void)
262262

263263
module_init(scx200_wdt_init);
264264
module_exit(scx200_wdt_cleanup);
265-
266-
/*
267-
Local variables:
268-
compile-command: "make -k -C ../.. SUBDIRS=drivers/char modules"
269-
c-basic-offset: 8
270-
End:
271-
*/

samples/connector/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ HOSTCFLAGS_ucon.o += -I$(objtree)/usr/include
1414
all: modules
1515

1616
modules clean:
17-
$(MAKE) -C ../.. SUBDIRS=$(CURDIR) $@
17+
$(MAKE) -C ../.. M=$(CURDIR) $@

0 commit comments

Comments
 (0)