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