Linux Audio

Check our new training course

Loading...
v6.13.7
  1======
  2Kbuild
  3======
  4
  5
  6Output files
  7============
  8
  9modules.order
 10-------------
 11This file records the order in which modules appear in Makefiles. This
 12is used by modprobe to deterministically resolve aliases that match
 13multiple modules.
 14
 15modules.builtin
 16---------------
 17This file lists all modules that are built into the kernel. This is used
 18by modprobe to not fail when trying to load something builtin.
 19
 20modules.builtin.modinfo
 21-----------------------
 22This file contains modinfo from all modules that are built into the kernel.
 23Unlike modinfo of a separate module, all fields are prefixed with module name.
 24
 25modules.builtin.ranges
 26----------------------
 27This file contains address offset ranges (per ELF section) for all modules
 28that are built into the kernel. Together with System.map, it can be used
 29to associate module names with symbols.
 30
 31Environment variables
 32=====================
 33
 34KCPPFLAGS
 35---------
 36Additional options to pass when preprocessing. The preprocessing options
 37will be used in all cases where kbuild does preprocessing including
 38building C files and assembler files.
 39
 40KAFLAGS
 41-------
 42Additional options to the assembler (for built-in and modules).
 43
 44AFLAGS_MODULE
 45-------------
 46Additional assembler options for modules.
 47
 48AFLAGS_KERNEL
 49-------------
 50Additional assembler options for built-in.
 51
 52KCFLAGS
 53-------
 54Additional options to the C compiler (for built-in and modules).
 55
 56KRUSTFLAGS
 57----------
 58Additional options to the Rust compiler (for built-in and modules).
 59
 60CFLAGS_KERNEL
 61-------------
 62Additional options for $(CC) when used to compile
 63code that is compiled as built-in.
 64
 65CFLAGS_MODULE
 66-------------
 67Additional module specific options to use for $(CC).
 68
 69RUSTFLAGS_KERNEL
 70----------------
 71Additional options for $(RUSTC) when used to compile
 72code that is compiled as built-in.
 73
 74RUSTFLAGS_MODULE
 75----------------
 76Additional module specific options to use for $(RUSTC).
 77
 78LDFLAGS_MODULE
 79--------------
 80Additional options used for $(LD) when linking modules.
 81
 82HOSTCFLAGS
 83----------
 84Additional flags to be passed to $(HOSTCC) when building host programs.
 85
 86HOSTCXXFLAGS
 87------------
 88Additional flags to be passed to $(HOSTCXX) when building host programs.
 89
 90HOSTRUSTFLAGS
 91-------------
 92Additional flags to be passed to $(HOSTRUSTC) when building host programs.
 93
 94HOSTLDFLAGS
 95-----------
 96Additional flags to be passed when linking host programs.
 97
 98HOSTLDLIBS
 99----------
100Additional libraries to link against when building host programs.
101
102.. _userkbuildflags:
103
104USERCFLAGS
105----------
106Additional options used for $(CC) when compiling userprogs.
107
108USERLDFLAGS
109-----------
110Additional options used for $(LD) when linking userprogs. userprogs are linked
111with CC, so $(USERLDFLAGS) should include "-Wl," prefix as applicable.
112
113KBUILD_KCONFIG
114--------------
115Set the top-level Kconfig file to the value of this environment
116variable.  The default name is "Kconfig".
117
118KBUILD_VERBOSE
119--------------
120Set the kbuild verbosity. Can be assigned same values as "V=...".
121
122See make help for the full list.
123
124Setting "V=..." takes precedence over KBUILD_VERBOSE.
125
126KBUILD_EXTMOD
127-------------
128Set the directory to look for the kernel source when building external
129modules.
130
131Setting "M=..." takes precedence over KBUILD_EXTMOD.
132
133KBUILD_OUTPUT
134-------------
135Specify the output directory when building the kernel.
136
137This variable can also be used to point to the kernel output directory when
138building external modules against a pre-built kernel in a separate build
139directory. Please note that this does NOT specify the output directory for the
140external modules themselves. (Use KBUILD_EXTMOD_OUTPUT for that purpose.)
141
142The output directory can also be specified using "O=...".
143
144Setting "O=..." takes precedence over KBUILD_OUTPUT.
145
146KBUILD_EXTMOD_OUTPUT
147--------------------
148Specify the output directory for external modules.
149
150Setting "MO=..." takes precedence over KBUILD_EXTMOD_OUTPUT.
151
152KBUILD_EXTRA_WARN
153-----------------
154Specify the extra build checks. The same value can be assigned by passing
155W=... from the command line.
156
157See `make help` for the list of the supported values.
158
159Setting "W=..." takes precedence over KBUILD_EXTRA_WARN.
160
161KBUILD_DEBARCH
162--------------
163For the deb-pkg target, allows overriding the normal heuristics deployed by
164deb-pkg. Normally deb-pkg attempts to guess the right architecture based on
165the UTS_MACHINE variable, and on some architectures also the kernel config.
166The value of KBUILD_DEBARCH is assumed (not checked) to be a valid Debian
167architecture.
168
169KDOCFLAGS
170---------
171Specify extra (warning/error) flags for kernel-doc checks during the build,
172see scripts/kernel-doc for which flags are supported. Note that this doesn't
173(currently) apply to documentation builds.
174
175ARCH
176----
177Set ARCH to the architecture to be built.
178
179In most cases the name of the architecture is the same as the
180directory name found in the arch/ directory.
181
182But some architectures such as x86 and sparc have aliases.
183
184- x86: i386 for 32 bit, x86_64 for 64 bit
185- parisc: parisc64 for 64 bit
186- sparc: sparc32 for 32 bit, sparc64 for 64 bit
187
188CROSS_COMPILE
189-------------
190Specify an optional fixed part of the binutils filename.
191CROSS_COMPILE can be a part of the filename or the full path.
192
193CROSS_COMPILE is also used for ccache in some setups.
194
195CF
196--
197Additional options for sparse.
198
199CF is often used on the command-line like this::
200
201    make CF=-Wbitwise C=2
202
203INSTALL_PATH
204------------
205INSTALL_PATH specifies where to place the updated kernel and system map
206images. Default is /boot, but you can set it to other values.
207
208INSTALLKERNEL
209-------------
210Install script called when using "make install".
211The default name is "installkernel".
212
213The script will be called with the following arguments:
214
215   - $1 - kernel version
216   - $2 - kernel image file
217   - $3 - kernel map file
218   - $4 - default install path (use root directory if blank)
219
220The implementation of "make install" is architecture specific
221and it may differ from the above.
222
223INSTALLKERNEL is provided to enable the possibility to
224specify a custom installer when cross compiling a kernel.
225
226MODLIB
227------
228Specify where to install modules.
229The default value is::
230
231     $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
232
233The value can be overridden in which case the default value is ignored.
234
235INSTALL_MOD_PATH
236----------------
237INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
238relocations required by build roots.  This is not defined in the
239makefile but the argument can be passed to make if needed.
240
241INSTALL_MOD_STRIP
242-----------------
243INSTALL_MOD_STRIP, if defined, will cause modules to be
244stripped after they are installed.  If INSTALL_MOD_STRIP is '1', then
245the default option --strip-debug will be used.  Otherwise,
246INSTALL_MOD_STRIP value will be used as the options to the strip command.
247
248INSTALL_HDR_PATH
249----------------
250INSTALL_HDR_PATH specifies where to install user space headers when
251executing "make headers_*".
252
253The default value is::
254
255    $(objtree)/usr
256
257$(objtree) is the directory where output files are saved.
258The output directory is often set using "O=..." on the commandline.
259
260The value can be overridden in which case the default value is ignored.
261
262INSTALL_DTBS_PATH
263-----------------
264INSTALL_DTBS_PATH specifies where to install device tree blobs for
265relocations required by build roots.  This is not defined in the
266makefile but the argument can be passed to make if needed.
267
268KBUILD_ABS_SRCTREE
269--------------------------------------------------
270Kbuild uses a relative path to point to the tree when possible. For instance,
271when building in the source tree, the source tree path is '.'
272
273Setting this flag requests Kbuild to use absolute path to the source tree.
274There are some useful cases to do so, like when generating tag files with
275absolute path entries etc.
276
277KBUILD_SIGN_PIN
278---------------
279This variable allows a passphrase or PIN to be passed to the sign-file
280utility when signing kernel modules, if the private key requires such.
281
282KBUILD_MODPOST_WARN
283-------------------
284KBUILD_MODPOST_WARN can be set to avoid errors in case of undefined
285symbols in the final module linking stage. It changes such errors
286into warnings.
287
288KBUILD_MODPOST_NOFINAL
289----------------------
290KBUILD_MODPOST_NOFINAL can be set to skip the final link of modules.
291This is solely useful to speed up test compiles.
292
293KBUILD_EXTRA_SYMBOLS
294--------------------
295For modules that use symbols from other modules.
296See more details in modules.rst.
297
298ALLSOURCE_ARCHS
299---------------
300For tags/TAGS/cscope targets, you can specify more than one arch
301to be included in the databases, separated by blank space. E.g.::
302
303    $ make ALLSOURCE_ARCHS="x86 mips arm" tags
304
305To get all available archs you can also specify all. E.g.::
306
307    $ make ALLSOURCE_ARCHS=all tags
308
309IGNORE_DIRS
310-----------
311For tags/TAGS/cscope targets, you can choose which directories won't
312be included in the databases, separated by blank space. E.g.::
313
314    $ make IGNORE_DIRS="drivers/gpu/drm/radeon tools" cscope
315
316KBUILD_BUILD_TIMESTAMP
317----------------------
318Setting this to a date string overrides the timestamp used in the
319UTS_VERSION definition (uname -v in the running kernel). The value has to
320be a string that can be passed to date -d. The default value
321is the output of the date command at one point during build.
322
323KBUILD_BUILD_USER, KBUILD_BUILD_HOST
324------------------------------------
325These two variables allow to override the user@host string displayed during
326boot and in /proc/version. The default value is the output of the commands
327whoami and host, respectively.
328
329LLVM
330----
331If this variable is set to 1, Kbuild will use Clang and LLVM utilities instead
332of GCC and GNU binutils to build the kernel.
v5.4
  1======
  2Kbuild
  3======
  4
  5
  6Output files
  7============
  8
  9modules.order
 10-------------
 11This file records the order in which modules appear in Makefiles. This
 12is used by modprobe to deterministically resolve aliases that match
 13multiple modules.
 14
 15modules.builtin
 16---------------
 17This file lists all modules that are built into the kernel. This is used
 18by modprobe to not fail when trying to load something builtin.
 19
 20modules.builtin.modinfo
 21-----------------------
 22This file contains modinfo from all modules that are built into the kernel.
 23Unlike modinfo of a separate module, all fields are prefixed with module name.
 24
 
 
 
 
 
 25
 26Environment variables
 27=====================
 28
 29KCPPFLAGS
 30---------
 31Additional options to pass when preprocessing. The preprocessing options
 32will be used in all cases where kbuild does preprocessing including
 33building C files and assembler files.
 34
 35KAFLAGS
 36-------
 37Additional options to the assembler (for built-in and modules).
 38
 39AFLAGS_MODULE
 40-------------
 41Additional assembler options for modules.
 42
 43AFLAGS_KERNEL
 44-------------
 45Additional assembler options for built-in.
 46
 47KCFLAGS
 48-------
 49Additional options to the C compiler (for built-in and modules).
 50
 
 
 
 
 51CFLAGS_KERNEL
 52-------------
 53Additional options for $(CC) when used to compile
 54code that is compiled as built-in.
 55
 56CFLAGS_MODULE
 57-------------
 58Additional module specific options to use for $(CC).
 59
 
 
 
 
 
 
 
 
 
 60LDFLAGS_MODULE
 61--------------
 62Additional options used for $(LD) when linking modules.
 63
 64HOSTCFLAGS
 65----------
 66Additional flags to be passed to $(HOSTCC) when building host programs.
 67
 68HOSTCXXFLAGS
 69------------
 70Additional flags to be passed to $(HOSTCXX) when building host programs.
 71
 
 
 
 
 72HOSTLDFLAGS
 73-----------
 74Additional flags to be passed when linking host programs.
 75
 76HOSTLDLIBS
 77----------
 78Additional libraries to link against when building host programs.
 79
 
 
 
 
 
 
 
 
 
 
 
 80KBUILD_KCONFIG
 81--------------
 82Set the top-level Kconfig file to the value of this environment
 83variable.  The default name is "Kconfig".
 84
 85KBUILD_VERBOSE
 86--------------
 87Set the kbuild verbosity. Can be assigned same values as "V=...".
 88
 89See make help for the full list.
 90
 91Setting "V=..." takes precedence over KBUILD_VERBOSE.
 92
 93KBUILD_EXTMOD
 94-------------
 95Set the directory to look for the kernel source when building external
 96modules.
 97
 98Setting "M=..." takes precedence over KBUILD_EXTMOD.
 99
100KBUILD_OUTPUT
101-------------
102Specify the output directory when building the kernel.
103
 
 
 
 
 
104The output directory can also be specified using "O=...".
105
106Setting "O=..." takes precedence over KBUILD_OUTPUT.
107
 
 
 
 
 
 
108KBUILD_EXTRA_WARN
109-----------------
110Specify the extra build checks. The same value can be assigned by passing
111W=... from the command line.
112
113See `make help` for the list of the supported values.
114
115Setting "W=..." takes precedence over KBUILD_EXTRA_WARN.
116
117KBUILD_DEBARCH
118--------------
119For the deb-pkg target, allows overriding the normal heuristics deployed by
120deb-pkg. Normally deb-pkg attempts to guess the right architecture based on
121the UTS_MACHINE variable, and on some architectures also the kernel config.
122The value of KBUILD_DEBARCH is assumed (not checked) to be a valid Debian
123architecture.
124
 
 
 
 
 
 
125ARCH
126----
127Set ARCH to the architecture to be built.
128
129In most cases the name of the architecture is the same as the
130directory name found in the arch/ directory.
131
132But some architectures such as x86 and sparc have aliases.
133
134- x86: i386 for 32 bit, x86_64 for 64 bit
135- sh: sh for 32 bit, sh64 for 64 bit
136- sparc: sparc32 for 32 bit, sparc64 for 64 bit
137
138CROSS_COMPILE
139-------------
140Specify an optional fixed part of the binutils filename.
141CROSS_COMPILE can be a part of the filename or the full path.
142
143CROSS_COMPILE is also used for ccache in some setups.
144
145CF
146--
147Additional options for sparse.
148
149CF is often used on the command-line like this::
150
151    make CF=-Wbitwise C=2
152
153INSTALL_PATH
154------------
155INSTALL_PATH specifies where to place the updated kernel and system map
156images. Default is /boot, but you can set it to other values.
157
158INSTALLKERNEL
159-------------
160Install script called when using "make install".
161The default name is "installkernel".
162
163The script will be called with the following arguments:
164
165   - $1 - kernel version
166   - $2 - kernel image file
167   - $3 - kernel map file
168   - $4 - default install path (use root directory if blank)
169
170The implementation of "make install" is architecture specific
171and it may differ from the above.
172
173INSTALLKERNEL is provided to enable the possibility to
174specify a custom installer when cross compiling a kernel.
175
176MODLIB
177------
178Specify where to install modules.
179The default value is::
180
181     $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
182
183The value can be overridden in which case the default value is ignored.
184
185INSTALL_MOD_PATH
186----------------
187INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
188relocations required by build roots.  This is not defined in the
189makefile but the argument can be passed to make if needed.
190
191INSTALL_MOD_STRIP
192-----------------
193INSTALL_MOD_STRIP, if defined, will cause modules to be
194stripped after they are installed.  If INSTALL_MOD_STRIP is '1', then
195the default option --strip-debug will be used.  Otherwise,
196INSTALL_MOD_STRIP value will be used as the options to the strip command.
197
198INSTALL_HDR_PATH
199----------------
200INSTALL_HDR_PATH specifies where to install user space headers when
201executing "make headers_*".
202
203The default value is::
204
205    $(objtree)/usr
206
207$(objtree) is the directory where output files are saved.
208The output directory is often set using "O=..." on the commandline.
209
210The value can be overridden in which case the default value is ignored.
211
 
 
 
 
 
 
212KBUILD_ABS_SRCTREE
213--------------------------------------------------
214Kbuild uses a relative path to point to the tree when possible. For instance,
215when building in the source tree, the source tree path is '.'
216
217Setting this flag requests Kbuild to use absolute path to the source tree.
218There are some useful cases to do so, like when generating tag files with
219absolute path entries etc.
220
221KBUILD_SIGN_PIN
222---------------
223This variable allows a passphrase or PIN to be passed to the sign-file
224utility when signing kernel modules, if the private key requires such.
225
226KBUILD_MODPOST_WARN
227-------------------
228KBUILD_MODPOST_WARN can be set to avoid errors in case of undefined
229symbols in the final module linking stage. It changes such errors
230into warnings.
231
232KBUILD_MODPOST_NOFINAL
233----------------------
234KBUILD_MODPOST_NOFINAL can be set to skip the final link of modules.
235This is solely useful to speed up test compiles.
236
237KBUILD_EXTRA_SYMBOLS
238--------------------
239For modules that use symbols from other modules.
240See more details in modules.txt.
241
242ALLSOURCE_ARCHS
243---------------
244For tags/TAGS/cscope targets, you can specify more than one arch
245to be included in the databases, separated by blank space. E.g.::
246
247    $ make ALLSOURCE_ARCHS="x86 mips arm" tags
248
249To get all available archs you can also specify all. E.g.::
250
251    $ make ALLSOURCE_ARCHS=all tags
252
 
 
 
 
 
 
 
253KBUILD_BUILD_TIMESTAMP
254----------------------
255Setting this to a date string overrides the timestamp used in the
256UTS_VERSION definition (uname -v in the running kernel). The value has to
257be a string that can be passed to date -d. The default value
258is the output of the date command at one point during build.
259
260KBUILD_BUILD_USER, KBUILD_BUILD_HOST
261------------------------------------
262These two variables allow to override the user@host string displayed during
263boot and in /proc/version. The default value is the output of the commands
264whoami and host, respectively.