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