Skip to content

Commit cd238ef

Browse files
mchehabJonathan Corbet
authored andcommitted
docs: kbuild: convert docs to ReST and rename to *.rst
The kbuild documentation clearly shows that the documents there are written at different times: some use markdown, some use their own peculiar logic to split sections. Convert everything to ReST without affecting too much the author's style and avoiding adding uneeded markups. The conversion is actually: - add blank lines and identation in order to identify paragraphs; - fix tables markups; - add some lists markups; - mark literal blocks; - adjust title markups. At its new index.rst, let's add a :orphan: while this is not linked to the main index.rst file, in order to avoid build warnings. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
1 parent d7b461c commit cd238ef

48 files changed

Lines changed: 846 additions & 567 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/admin-guide/README.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ Configuring the kernel
227227
"make tinyconfig" Configure the tiniest possible kernel.
228228

229229
You can find more information on using the Linux kernel config tools
230-
in Documentation/kbuild/kconfig.txt.
230+
in Documentation/kbuild/kconfig.rst.
231231

232232
- NOTES on ``make config``:
233233

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
=============================================
12
Exporting kernel headers for use by userspace
23
=============================================
34

@@ -22,14 +23,14 @@ older kernel.
2223

2324
The "make headers_install" command can be run in the top level directory of the
2425
kernel source code (or using a standard out-of-tree build). It takes two
25-
optional arguments:
26+
optional arguments::
2627

2728
make headers_install ARCH=i386 INSTALL_HDR_PATH=/usr
2829

2930
ARCH indicates which architecture to produce headers for, and defaults to the
3031
current architecture. The linux/asm directory of the exported kernel headers
3132
is platform-specific, to see a complete list of supported architectures use
32-
the command:
33+
the command::
3334

3435
ls -d include/asm-* | sed 's/.*-//'
3536

‎Documentation/kbuild/index.rst‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
:orphan:
2+
3+
===================
4+
Kernel Build System
5+
===================
6+
7+
.. toctree::
8+
:maxdepth: 1
9+
10+
kconfig-language
11+
kconfig-macro-language
12+
13+
kbuild
14+
kconfig
15+
makefiles
16+
modules
17+
18+
headers_install
19+
20+
issues
21+
22+
.. only:: subproject and html
23+
24+
Indices
25+
=======
26+
27+
* :ref:`genindex`

‎Documentation/kbuild/issues.rst‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Recursion issue #1
2+
------------------
3+
4+
.. include:: Kconfig.recursion-issue-01
5+
:literal:
6+
7+
Recursion issue #2
8+
------------------
9+
10+
.. include:: Kconfig.recursion-issue-02
11+
:literal:
Lines changed: 68 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
1+
======
2+
Kbuild
3+
======
4+
5+
16
Output files
7+
============
28

39
modules.order
4-
--------------------------------------------------
10+
-------------
511
This file records the order in which modules appear in Makefiles. This
612
is used by modprobe to deterministically resolve aliases that match
713
multiple modules.
814

915
modules.builtin
10-
--------------------------------------------------
16+
---------------
1117
This file lists all modules that are built into the kernel. This is used
1218
by modprobe to not fail when trying to load something builtin.
1319

@@ -18,129 +24,139 @@ Unlike modinfo of a separate module, all fields are prefixed with module name.
1824

1925

2026
Environment variables
27+
=====================
2128

2229
KCPPFLAGS
23-
--------------------------------------------------
30+
---------
2431
Additional options to pass when preprocessing. The preprocessing options
2532
will be used in all cases where kbuild does preprocessing including
2633
building C files and assembler files.
2734

2835
KAFLAGS
29-
--------------------------------------------------
36+
-------
3037
Additional options to the assembler (for built-in and modules).
3138

3239
AFLAGS_MODULE
33-
--------------------------------------------------
40+
-------------
3441
Additional module specific options to use for $(AS).
3542

3643
AFLAGS_KERNEL
37-
--------------------------------------------------
44+
-------------
3845
Additional options for $(AS) when used for assembler
3946
code for code that is compiled as built-in.
4047

4148
KCFLAGS
42-
--------------------------------------------------
49+
-------
4350
Additional options to the C compiler (for built-in and modules).
4451

4552
CFLAGS_KERNEL
46-
--------------------------------------------------
53+
-------------
4754
Additional options for $(CC) when used to compile
4855
code that is compiled as built-in.
4956

5057
CFLAGS_MODULE
51-
--------------------------------------------------
58+
-------------
5259
Additional module specific options to use for $(CC).
5360

5461
LDFLAGS_MODULE
55-
--------------------------------------------------
62+
--------------
5663
Additional options used for $(LD) when linking modules.
5764

5865
HOSTCFLAGS
59-
--------------------------------------------------
66+
----------
6067
Additional flags to be passed to $(HOSTCC) when building host programs.
6168

6269
HOSTCXXFLAGS
63-
--------------------------------------------------
70+
------------
6471
Additional flags to be passed to $(HOSTCXX) when building host programs.
6572

6673
HOSTLDFLAGS
67-
--------------------------------------------------
74+
-----------
6875
Additional flags to be passed when linking host programs.
6976

7077
HOSTLDLIBS
71-
--------------------------------------------------
78+
----------
7279
Additional libraries to link against when building host programs.
7380

7481
KBUILD_KCONFIG
75-
--------------------------------------------------
82+
--------------
7683
Set the top-level Kconfig file to the value of this environment
7784
variable. The default name is "Kconfig".
7885

7986
KBUILD_VERBOSE
80-
--------------------------------------------------
87+
--------------
8188
Set the kbuild verbosity. Can be assigned same values as "V=...".
89+
8290
See make help for the full list.
91+
8392
Setting "V=..." takes precedence over KBUILD_VERBOSE.
8493

8594
KBUILD_EXTMOD
86-
--------------------------------------------------
95+
-------------
8796
Set the directory to look for the kernel source when building external
8897
modules.
98+
8999
Setting "M=..." takes precedence over KBUILD_EXTMOD.
90100

91101
KBUILD_OUTPUT
92-
--------------------------------------------------
102+
-------------
93103
Specify the output directory when building the kernel.
104+
94105
The output directory can also be specified using "O=...".
106+
95107
Setting "O=..." takes precedence over KBUILD_OUTPUT.
96108

97109
KBUILD_DEBARCH
98-
--------------------------------------------------
110+
--------------
99111
For the deb-pkg target, allows overriding the normal heuristics deployed by
100112
deb-pkg. Normally deb-pkg attempts to guess the right architecture based on
101113
the UTS_MACHINE variable, and on some architectures also the kernel config.
102114
The value of KBUILD_DEBARCH is assumed (not checked) to be a valid Debian
103115
architecture.
104116

105117
ARCH
106-
--------------------------------------------------
118+
----
107119
Set ARCH to the architecture to be built.
120+
108121
In most cases the name of the architecture is the same as the
109122
directory name found in the arch/ directory.
123+
110124
But some architectures such as x86 and sparc have aliases.
111-
x86: i386 for 32 bit, x86_64 for 64 bit
112-
sh: sh for 32 bit, sh64 for 64 bit
113-
sparc: sparc32 for 32 bit, sparc64 for 64 bit
125+
126+
- x86: i386 for 32 bit, x86_64 for 64 bit
127+
- sh: sh for 32 bit, sh64 for 64 bit
128+
- sparc: sparc32 for 32 bit, sparc64 for 64 bit
114129

115130
CROSS_COMPILE
116-
--------------------------------------------------
131+
-------------
117132
Specify an optional fixed part of the binutils filename.
118133
CROSS_COMPILE can be a part of the filename or the full path.
119134

120135
CROSS_COMPILE is also used for ccache in some setups.
121136

122137
CF
123-
--------------------------------------------------
138+
--
124139
Additional options for sparse.
125-
CF is often used on the command-line like this:
140+
141+
CF is often used on the command-line like this::
126142

127143
make CF=-Wbitwise C=2
128144

129145
INSTALL_PATH
130-
--------------------------------------------------
146+
------------
131147
INSTALL_PATH specifies where to place the updated kernel and system map
132148
images. Default is /boot, but you can set it to other values.
133149

134150
INSTALLKERNEL
135-
--------------------------------------------------
151+
-------------
136152
Install script called when using "make install".
137153
The default name is "installkernel".
138154

139155
The script will be called with the following arguments:
140-
$1 - kernel version
141-
$2 - kernel image file
142-
$3 - kernel map file
143-
$4 - default install path (use root directory if blank)
156+
- $1 - kernel version
157+
- $2 - kernel image file
158+
- $3 - kernel map file
159+
- $4 - default install path (use root directory if blank)
144160

145161
The implementation of "make install" is architecture specific
146162
and it may differ from the above.
@@ -149,32 +165,33 @@ INSTALLKERNEL is provided to enable the possibility to
149165
specify a custom installer when cross compiling a kernel.
150166

151167
MODLIB
152-
--------------------------------------------------
168+
------
153169
Specify where to install modules.
154-
The default value is:
170+
The default value is::
155171

156172
$(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
157173

158174
The value can be overridden in which case the default value is ignored.
159175

160176
INSTALL_MOD_PATH
161-
--------------------------------------------------
177+
----------------
162178
INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
163179
relocations required by build roots. This is not defined in the
164180
makefile but the argument can be passed to make if needed.
165181

166182
INSTALL_MOD_STRIP
167-
--------------------------------------------------
183+
-----------------
168184
INSTALL_MOD_STRIP, if defined, will cause modules to be
169185
stripped after they are installed. If INSTALL_MOD_STRIP is '1', then
170186
the default option --strip-debug will be used. Otherwise,
171187
INSTALL_MOD_STRIP value will be used as the options to the strip command.
172188

173189
INSTALL_HDR_PATH
174-
--------------------------------------------------
190+
----------------
175191
INSTALL_HDR_PATH specifies where to install user space headers when
176192
executing "make headers_*".
177-
The default value is:
193+
194+
The default value is::
178195

179196
$(objtree)/usr
180197

@@ -184,65 +201,65 @@ The output directory is often set using "O=..." on the commandline.
184201
The value can be overridden in which case the default value is ignored.
185202

186203
KBUILD_SIGN_PIN
187-
--------------------------------------------------
204+
---------------
188205
This variable allows a passphrase or PIN to be passed to the sign-file
189206
utility when signing kernel modules, if the private key requires such.
190207

191208
KBUILD_MODPOST_WARN
192-
--------------------------------------------------
209+
-------------------
193210
KBUILD_MODPOST_WARN can be set to avoid errors in case of undefined
194211
symbols in the final module linking stage. It changes such errors
195212
into warnings.
196213

197214
KBUILD_MODPOST_NOFINAL
198-
--------------------------------------------------
215+
----------------------
199216
KBUILD_MODPOST_NOFINAL can be set to skip the final link of modules.
200217
This is solely useful to speed up test compiles.
201218

202219
KBUILD_EXTRA_SYMBOLS
203-
--------------------------------------------------
220+
--------------------
204221
For modules that use symbols from other modules.
205222
See more details in modules.txt.
206223

207224
ALLSOURCE_ARCHS
208-
--------------------------------------------------
225+
---------------
209226
For tags/TAGS/cscope targets, you can specify more than one arch
210-
to be included in the databases, separated by blank space. E.g.:
227+
to be included in the databases, separated by blank space. E.g.::
211228

212229
$ make ALLSOURCE_ARCHS="x86 mips arm" tags
213230

214-
To get all available archs you can also specify all. E.g.:
231+
To get all available archs you can also specify all. E.g.::
215232

216233
$ make ALLSOURCE_ARCHS=all tags
217234

218235
KBUILD_ENABLE_EXTRA_GCC_CHECKS
219-
--------------------------------------------------
236+
------------------------------
220237
If enabled over the make command line with "W=1", it turns on additional
221238
gcc -W... options for more extensive build-time checking.
222239

223240
KBUILD_BUILD_TIMESTAMP
224-
--------------------------------------------------
241+
----------------------
225242
Setting this to a date string overrides the timestamp used in the
226243
UTS_VERSION definition (uname -v in the running kernel). The value has to
227244
be a string that can be passed to date -d. The default value
228245
is the output of the date command at one point during build.
229246

230247
KBUILD_BUILD_USER, KBUILD_BUILD_HOST
231-
--------------------------------------------------
248+
------------------------------------
232249
These two variables allow to override the user@host string displayed during
233250
boot and in /proc/version. The default value is the output of the commands
234251
whoami and host, respectively.
235252

236253
KBUILD_LDS
237-
--------------------------------------------------
254+
----------
238255
The linker script with full path. Assigned by the top-level Makefile.
239256

240257
KBUILD_VMLINUX_OBJS
241-
--------------------------------------------------
258+
-------------------
242259
All object files for vmlinux. They are linked to vmlinux in the same
243260
order as listed in KBUILD_VMLINUX_OBJS.
244261

245262
KBUILD_VMLINUX_LIBS
246-
--------------------------------------------------
263+
-------------------
247264
All .a "lib" files for vmlinux. KBUILD_VMLINUX_OBJS and KBUILD_VMLINUX_LIBS
248265
together specify all the object files used to link vmlinux.

0 commit comments

Comments
 (0)