Skip to content

Commit 062a148

Browse files
committed
kbuild: doc: update the description about Kbuild/Makefile split
The phrase "In newer versions of the kernel" was added 14 years ago, by commit efdf02c ("Documentation/kbuild: major edit of modules.txt sections 1-4"). This feature is no longer new, so remove it and update the paragraph. Example 3 was written 20 years ago [1]. There is no need to note about backward compatibility with such an old build system. Remove Example 3 entirely. [1]: https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/commit/?id=65e433436b5794ae056d22ddba60fe9194bba007 Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nicolas Schier <n.schier@avm.de>
1 parent fc1c79b commit 062a148

File tree

1 file changed

+3
-35
lines changed

1 file changed

+3
-35
lines changed

Documentation/kbuild/modules.rst

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,9 @@ module 8123.ko, which is built from the following files::
224224
3.2 Separate Kbuild File and Makefile
225225
-------------------------------------
226226

227-
In newer versions of the kernel, kbuild will first look for a
228-
file named "Kbuild," and only if that is not found, will it
229-
then look for a makefile. Utilizing a "Kbuild" file allows us
230-
to split up the makefile from example 1 into two files:
227+
Kbuild will first look for a file named "Kbuild", and if it is not
228+
found, it will then look for "Makefile". Utilizing a "Kbuild" file
229+
allows us to split up the "Makefile" from example 1 into two files:
231230

232231
Example 2::
233232

@@ -250,37 +249,6 @@ module 8123.ko, which is built from the following files::
250249
consisting of several hundred lines, and here it really pays
251250
off to separate the kbuild part from the rest.
252251

253-
The next example shows a backward compatible version.
254-
255-
Example 3::
256-
257-
--> filename: Kbuild
258-
obj-m := 8123.o
259-
8123-y := 8123_if.o 8123_pci.o 8123_bin.o
260-
261-
--> filename: Makefile
262-
ifneq ($(KERNELRELEASE),)
263-
# kbuild part of makefile
264-
include Kbuild
265-
266-
else
267-
# normal makefile
268-
KDIR ?= /lib/modules/`uname -r`/build
269-
270-
default:
271-
$(MAKE) -C $(KDIR) M=$$PWD
272-
273-
# Module specific targets
274-
genbin:
275-
echo "X" > 8123_bin.o_shipped
276-
277-
endif
278-
279-
Here the "Kbuild" file is included from the makefile. This
280-
allows an older version of kbuild, which only knows of
281-
makefiles, to be used when the "make" and kbuild parts are
282-
split into separate files.
283-
284252
3.3 Binary Blobs
285253
----------------
286254

0 commit comments

Comments
 (0)