1+ ======
2+ Kbuild
3+ ======
4+
5+
16Output files
7+ ============
28
39modules.order
4- --------------------------------------------------
10+ -------------
511This file records the order in which modules appear in Makefiles. This
612is used by modprobe to deterministically resolve aliases that match
713multiple modules.
814
915modules.builtin
10- --------------------------------------------------
16+ ---------------
1117This file lists all modules that are built into the kernel. This is used
1218by 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
2026Environment variables
27+ =====================
2128
2229KCPPFLAGS
23- --------------------------------------------------
30+ ---------
2431Additional options to pass when preprocessing. The preprocessing options
2532will be used in all cases where kbuild does preprocessing including
2633building C files and assembler files.
2734
2835KAFLAGS
29- --------------------------------------------------
36+ -------
3037Additional options to the assembler (for built-in and modules).
3138
3239AFLAGS_MODULE
33- --------------------------------------------------
40+ -------------
3441Additional module specific options to use for $(AS).
3542
3643AFLAGS_KERNEL
37- --------------------------------------------------
44+ -------------
3845Additional options for $(AS) when used for assembler
3946code for code that is compiled as built-in.
4047
4148KCFLAGS
42- --------------------------------------------------
49+ -------
4350Additional options to the C compiler (for built-in and modules).
4451
4552CFLAGS_KERNEL
46- --------------------------------------------------
53+ -------------
4754Additional options for $(CC) when used to compile
4855code that is compiled as built-in.
4956
5057CFLAGS_MODULE
51- --------------------------------------------------
58+ -------------
5259Additional module specific options to use for $(CC).
5360
5461LDFLAGS_MODULE
55- --------------------------------------------------
62+ --------------
5663Additional options used for $(LD) when linking modules.
5764
5865HOSTCFLAGS
59- --------------------------------------------------
66+ ----------
6067Additional flags to be passed to $(HOSTCC) when building host programs.
6168
6269HOSTCXXFLAGS
63- --------------------------------------------------
70+ ------------
6471Additional flags to be passed to $(HOSTCXX) when building host programs.
6572
6673HOSTLDFLAGS
67- --------------------------------------------------
74+ -----------
6875Additional flags to be passed when linking host programs.
6976
7077HOSTLDLIBS
71- --------------------------------------------------
78+ ----------
7279Additional libraries to link against when building host programs.
7380
7481KBUILD_KCONFIG
75- --------------------------------------------------
82+ --------------
7683Set the top-level Kconfig file to the value of this environment
7784variable. The default name is "Kconfig".
7885
7986KBUILD_VERBOSE
80- --------------------------------------------------
87+ --------------
8188Set the kbuild verbosity. Can be assigned same values as "V=...".
89+
8290See make help for the full list.
91+
8392Setting "V=..." takes precedence over KBUILD_VERBOSE.
8493
8594KBUILD_EXTMOD
86- --------------------------------------------------
95+ -------------
8796Set the directory to look for the kernel source when building external
8897modules.
98+
8999Setting "M=..." takes precedence over KBUILD_EXTMOD.
90100
91101KBUILD_OUTPUT
92- --------------------------------------------------
102+ -------------
93103Specify the output directory when building the kernel.
104+
94105The output directory can also be specified using "O=...".
106+
95107Setting "O=..." takes precedence over KBUILD_OUTPUT.
96108
97109KBUILD_DEBARCH
98- --------------------------------------------------
110+ --------------
99111For the deb-pkg target, allows overriding the normal heuristics deployed by
100112deb-pkg. Normally deb-pkg attempts to guess the right architecture based on
101113the UTS_MACHINE variable, and on some architectures also the kernel config.
102114The value of KBUILD_DEBARCH is assumed (not checked) to be a valid Debian
103115architecture.
104116
105117ARCH
106- --------------------------------------------------
118+ ----
107119Set ARCH to the architecture to be built.
120+
108121In most cases the name of the architecture is the same as the
109122directory name found in the arch/ directory.
123+
110124But 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
115130CROSS_COMPILE
116- --------------------------------------------------
131+ -------------
117132Specify an optional fixed part of the binutils filename.
118133CROSS_COMPILE can be a part of the filename or the full path.
119134
120135CROSS_COMPILE is also used for ccache in some setups.
121136
122137CF
123- --------------------------------------------------
138+ --
124139Additional 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
129145INSTALL_PATH
130- --------------------------------------------------
146+ ------------
131147INSTALL_PATH specifies where to place the updated kernel and system map
132148images. Default is /boot, but you can set it to other values.
133149
134150INSTALLKERNEL
135- --------------------------------------------------
151+ -------------
136152Install script called when using "make install".
137153The default name is "installkernel".
138154
139155The 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
145161The implementation of "make install" is architecture specific
146162and it may differ from the above.
@@ -149,32 +165,33 @@ INSTALLKERNEL is provided to enable the possibility to
149165specify a custom installer when cross compiling a kernel.
150166
151167MODLIB
152- --------------------------------------------------
168+ ------
153169Specify where to install modules.
154- The default value is:
170+ The default value is::
155171
156172 $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
157173
158174The value can be overridden in which case the default value is ignored.
159175
160176INSTALL_MOD_PATH
161- --------------------------------------------------
177+ ----------------
162178INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
163179relocations required by build roots. This is not defined in the
164180makefile but the argument can be passed to make if needed.
165181
166182INSTALL_MOD_STRIP
167- --------------------------------------------------
183+ -----------------
168184INSTALL_MOD_STRIP, if defined, will cause modules to be
169185stripped after they are installed. If INSTALL_MOD_STRIP is '1', then
170186the default option --strip-debug will be used. Otherwise,
171187INSTALL_MOD_STRIP value will be used as the options to the strip command.
172188
173189INSTALL_HDR_PATH
174- --------------------------------------------------
190+ ----------------
175191INSTALL_HDR_PATH specifies where to install user space headers when
176192executing "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.
184201The value can be overridden in which case the default value is ignored.
185202
186203KBUILD_SIGN_PIN
187- --------------------------------------------------
204+ ---------------
188205This variable allows a passphrase or PIN to be passed to the sign-file
189206utility when signing kernel modules, if the private key requires such.
190207
191208KBUILD_MODPOST_WARN
192- --------------------------------------------------
209+ -------------------
193210KBUILD_MODPOST_WARN can be set to avoid errors in case of undefined
194211symbols in the final module linking stage. It changes such errors
195212into warnings.
196213
197214KBUILD_MODPOST_NOFINAL
198- --------------------------------------------------
215+ ----------------------
199216KBUILD_MODPOST_NOFINAL can be set to skip the final link of modules.
200217This is solely useful to speed up test compiles.
201218
202219KBUILD_EXTRA_SYMBOLS
203- --------------------------------------------------
220+ --------------------
204221For modules that use symbols from other modules.
205222See more details in modules.txt.
206223
207224ALLSOURCE_ARCHS
208- --------------------------------------------------
225+ ---------------
209226For 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
218235KBUILD_ENABLE_EXTRA_GCC_CHECKS
219- --------------------------------------------------
236+ ------------------------------
220237If enabled over the make command line with "W=1", it turns on additional
221238gcc -W... options for more extensive build-time checking.
222239
223240KBUILD_BUILD_TIMESTAMP
224- --------------------------------------------------
241+ ----------------------
225242Setting this to a date string overrides the timestamp used in the
226243UTS_VERSION definition (uname -v in the running kernel). The value has to
227244be a string that can be passed to date -d. The default value
228245is the output of the date command at one point during build.
229246
230247KBUILD_BUILD_USER, KBUILD_BUILD_HOST
231- --------------------------------------------------
248+ ------------------------------------
232249These two variables allow to override the user@host string displayed during
233250boot and in /proc/version. The default value is the output of the commands
234251whoami and host, respectively.
235252
236253KBUILD_LDS
237- --------------------------------------------------
254+ ----------
238255The linker script with full path. Assigned by the top-level Makefile.
239256
240257KBUILD_VMLINUX_OBJS
241- --------------------------------------------------
258+ -------------------
242259All object files for vmlinux. They are linked to vmlinux in the same
243260order as listed in KBUILD_VMLINUX_OBJS.
244261
245262KBUILD_VMLINUX_LIBS
246- --------------------------------------------------
263+ -------------------
247264All .a "lib" files for vmlinux. KBUILD_VMLINUX_OBJS and KBUILD_VMLINUX_LIBS
248265together specify all the object files used to link vmlinux.
0 commit comments