0001 ======
0002 Kbuild
0003 ======
0004
0005
0006 Output files
0007 ============
0008
0009 modules.order
0010 -------------
0011 This file records the order in which modules appear in Makefiles. This
0012 is used by modprobe to deterministically resolve aliases that match
0013 multiple modules.
0014
0015 modules.builtin
0016 ---------------
0017 This file lists all modules that are built into the kernel. This is used
0018 by modprobe to not fail when trying to load something builtin.
0019
0020 modules.builtin.modinfo
0021 -----------------------
0022 This file contains modinfo from all modules that are built into the kernel.
0023 Unlike modinfo of a separate module, all fields are prefixed with module name.
0024
0025
0026 Environment variables
0027 =====================
0028
0029 KCPPFLAGS
0030 ---------
0031 Additional options to pass when preprocessing. The preprocessing options
0032 will be used in all cases where kbuild does preprocessing including
0033 building C files and assembler files.
0034
0035 KAFLAGS
0036 -------
0037 Additional options to the assembler (for built-in and modules).
0038
0039 AFLAGS_MODULE
0040 -------------
0041 Additional assembler options for modules.
0042
0043 AFLAGS_KERNEL
0044 -------------
0045 Additional assembler options for built-in.
0046
0047 KCFLAGS
0048 -------
0049 Additional options to the C compiler (for built-in and modules).
0050
0051 CFLAGS_KERNEL
0052 -------------
0053 Additional options for $(CC) when used to compile
0054 code that is compiled as built-in.
0055
0056 CFLAGS_MODULE
0057 -------------
0058 Additional module specific options to use for $(CC).
0059
0060 LDFLAGS_MODULE
0061 --------------
0062 Additional options used for $(LD) when linking modules.
0063
0064 HOSTCFLAGS
0065 ----------
0066 Additional flags to be passed to $(HOSTCC) when building host programs.
0067
0068 HOSTCXXFLAGS
0069 ------------
0070 Additional flags to be passed to $(HOSTCXX) when building host programs.
0071
0072 HOSTLDFLAGS
0073 -----------
0074 Additional flags to be passed when linking host programs.
0075
0076 HOSTLDLIBS
0077 ----------
0078 Additional libraries to link against when building host programs.
0079
0080 .. _userkbuildflags:
0081
0082 USERCFLAGS
0083 ----------
0084 Additional options used for $(CC) when compiling userprogs.
0085
0086 USERLDFLAGS
0087 -----------
0088 Additional options used for $(LD) when linking userprogs. userprogs are linked
0089 with CC, so $(USERLDFLAGS) should include "-Wl," prefix as applicable.
0090
0091 KBUILD_KCONFIG
0092 --------------
0093 Set the top-level Kconfig file to the value of this environment
0094 variable. The default name is "Kconfig".
0095
0096 KBUILD_VERBOSE
0097 --------------
0098 Set the kbuild verbosity. Can be assigned same values as "V=...".
0099
0100 See make help for the full list.
0101
0102 Setting "V=..." takes precedence over KBUILD_VERBOSE.
0103
0104 KBUILD_EXTMOD
0105 -------------
0106 Set the directory to look for the kernel source when building external
0107 modules.
0108
0109 Setting "M=..." takes precedence over KBUILD_EXTMOD.
0110
0111 KBUILD_OUTPUT
0112 -------------
0113 Specify the output directory when building the kernel.
0114
0115 The output directory can also be specified using "O=...".
0116
0117 Setting "O=..." takes precedence over KBUILD_OUTPUT.
0118
0119 KBUILD_EXTRA_WARN
0120 -----------------
0121 Specify the extra build checks. The same value can be assigned by passing
0122 W=... from the command line.
0123
0124 See `make help` for the list of the supported values.
0125
0126 Setting "W=..." takes precedence over KBUILD_EXTRA_WARN.
0127
0128 KBUILD_DEBARCH
0129 --------------
0130 For the deb-pkg target, allows overriding the normal heuristics deployed by
0131 deb-pkg. Normally deb-pkg attempts to guess the right architecture based on
0132 the UTS_MACHINE variable, and on some architectures also the kernel config.
0133 The value of KBUILD_DEBARCH is assumed (not checked) to be a valid Debian
0134 architecture.
0135
0136 ARCH
0137 ----
0138 Set ARCH to the architecture to be built.
0139
0140 In most cases the name of the architecture is the same as the
0141 directory name found in the arch/ directory.
0142
0143 But some architectures such as x86 and sparc have aliases.
0144
0145 - x86: i386 for 32 bit, x86_64 for 64 bit
0146 - sh: sh for 32 bit, sh64 for 64 bit
0147 - sparc: sparc32 for 32 bit, sparc64 for 64 bit
0148
0149 CROSS_COMPILE
0150 -------------
0151 Specify an optional fixed part of the binutils filename.
0152 CROSS_COMPILE can be a part of the filename or the full path.
0153
0154 CROSS_COMPILE is also used for ccache in some setups.
0155
0156 CF
0157 --
0158 Additional options for sparse.
0159
0160 CF is often used on the command-line like this::
0161
0162 make CF=-Wbitwise C=2
0163
0164 INSTALL_PATH
0165 ------------
0166 INSTALL_PATH specifies where to place the updated kernel and system map
0167 images. Default is /boot, but you can set it to other values.
0168
0169 INSTALLKERNEL
0170 -------------
0171 Install script called when using "make install".
0172 The default name is "installkernel".
0173
0174 The script will be called with the following arguments:
0175
0176 - $1 - kernel version
0177 - $2 - kernel image file
0178 - $3 - kernel map file
0179 - $4 - default install path (use root directory if blank)
0180
0181 The implementation of "make install" is architecture specific
0182 and it may differ from the above.
0183
0184 INSTALLKERNEL is provided to enable the possibility to
0185 specify a custom installer when cross compiling a kernel.
0186
0187 MODLIB
0188 ------
0189 Specify where to install modules.
0190 The default value is::
0191
0192 $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
0193
0194 The value can be overridden in which case the default value is ignored.
0195
0196 INSTALL_MOD_PATH
0197 ----------------
0198 INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
0199 relocations required by build roots. This is not defined in the
0200 makefile but the argument can be passed to make if needed.
0201
0202 INSTALL_MOD_STRIP
0203 -----------------
0204 INSTALL_MOD_STRIP, if defined, will cause modules to be
0205 stripped after they are installed. If INSTALL_MOD_STRIP is '1', then
0206 the default option --strip-debug will be used. Otherwise,
0207 INSTALL_MOD_STRIP value will be used as the options to the strip command.
0208
0209 INSTALL_HDR_PATH
0210 ----------------
0211 INSTALL_HDR_PATH specifies where to install user space headers when
0212 executing "make headers_*".
0213
0214 The default value is::
0215
0216 $(objtree)/usr
0217
0218 $(objtree) is the directory where output files are saved.
0219 The output directory is often set using "O=..." on the commandline.
0220
0221 The value can be overridden in which case the default value is ignored.
0222
0223 KBUILD_ABS_SRCTREE
0224 --------------------------------------------------
0225 Kbuild uses a relative path to point to the tree when possible. For instance,
0226 when building in the source tree, the source tree path is '.'
0227
0228 Setting this flag requests Kbuild to use absolute path to the source tree.
0229 There are some useful cases to do so, like when generating tag files with
0230 absolute path entries etc.
0231
0232 KBUILD_SIGN_PIN
0233 ---------------
0234 This variable allows a passphrase or PIN to be passed to the sign-file
0235 utility when signing kernel modules, if the private key requires such.
0236
0237 KBUILD_MODPOST_WARN
0238 -------------------
0239 KBUILD_MODPOST_WARN can be set to avoid errors in case of undefined
0240 symbols in the final module linking stage. It changes such errors
0241 into warnings.
0242
0243 KBUILD_MODPOST_NOFINAL
0244 ----------------------
0245 KBUILD_MODPOST_NOFINAL can be set to skip the final link of modules.
0246 This is solely useful to speed up test compiles.
0247
0248 KBUILD_EXTRA_SYMBOLS
0249 --------------------
0250 For modules that use symbols from other modules.
0251 See more details in modules.rst.
0252
0253 ALLSOURCE_ARCHS
0254 ---------------
0255 For tags/TAGS/cscope targets, you can specify more than one arch
0256 to be included in the databases, separated by blank space. E.g.::
0257
0258 $ make ALLSOURCE_ARCHS="x86 mips arm" tags
0259
0260 To get all available archs you can also specify all. E.g.::
0261
0262 $ make ALLSOURCE_ARCHS=all tags
0263
0264 KBUILD_BUILD_TIMESTAMP
0265 ----------------------
0266 Setting this to a date string overrides the timestamp used in the
0267 UTS_VERSION definition (uname -v in the running kernel). The value has to
0268 be a string that can be passed to date -d. The default value
0269 is the output of the date command at one point during build.
0270
0271 KBUILD_BUILD_USER, KBUILD_BUILD_HOST
0272 ------------------------------------
0273 These two variables allow to override the user@host string displayed during
0274 boot and in /proc/version. The default value is the output of the commands
0275 whoami and host, respectively.
0276
0277 LLVM
0278 ----
0279 If this variable is set to 1, Kbuild will use Clang and LLVM utilities instead
0280 of GCC and GNU binutils to build the kernel.