Michal Marek | bc081dd | 2009-12-07 16:38:33 +0100 | [diff] [blame] | 1 | Output files |
| 2 | |
| 3 | modules.order |
| 4 | -------------------------------------------------- |
| 5 | This file records the order in which modules appear in Makefiles. This |
| 6 | is used by modprobe to deterministically resolve aliases that match |
| 7 | multiple modules. |
| 8 | |
| 9 | modules.builtin |
| 10 | -------------------------------------------------- |
| 11 | This file lists all modules that are built into the kernel. This is used |
| 12 | by modprobe to not fail when trying to load something builtin. |
| 13 | |
| 14 | |
Sam Ravnborg | acc08b5 | 2008-12-29 13:45:52 +0100 | [diff] [blame] | 15 | Environment variables |
| 16 | |
| 17 | KCPPFLAGS |
| 18 | -------------------------------------------------- |
| 19 | Additional options to pass when preprocessing. The preprocessing options |
Randy Dunlap | df291fa | 2009-01-08 10:59:34 -0800 | [diff] [blame] | 20 | will be used in all cases where kbuild does preprocessing including |
Sam Ravnborg | acc08b5 | 2008-12-29 13:45:52 +0100 | [diff] [blame] | 21 | building C files and assembler files. |
| 22 | |
| 23 | KAFLAGS |
| 24 | -------------------------------------------------- |
Sam Ravnborg | 6588169 | 2010-07-28 17:33:09 +0200 | [diff] [blame] | 25 | Additional options to the assembler (for built-in and modules). |
| 26 | |
| 27 | AFLAGS_MODULE |
| 28 | -------------------------------------------------- |
Lucas De Marchi | 25985ed | 2011-03-30 22:57:33 -0300 | [diff] [blame] | 29 | Additional module specific options to use for $(AS). |
Sam Ravnborg | acc08b5 | 2008-12-29 13:45:52 +0100 | [diff] [blame] | 30 | |
Sam Ravnborg | 80c00ba | 2010-07-28 19:11:27 +0200 | [diff] [blame] | 31 | AFLAGS_KERNEL |
| 32 | -------------------------------------------------- |
Lucas De Marchi | 25985ed | 2011-03-30 22:57:33 -0300 | [diff] [blame] | 33 | Additional options for $(AS) when used for assembler |
Sam Ravnborg | 80c00ba | 2010-07-28 19:11:27 +0200 | [diff] [blame] | 34 | code for code that is compiled as built-in. |
Sam Ravnborg | acc08b5 | 2008-12-29 13:45:52 +0100 | [diff] [blame] | 35 | |
| 36 | KCFLAGS |
| 37 | -------------------------------------------------- |
Sam Ravnborg | 6588169 | 2010-07-28 17:33:09 +0200 | [diff] [blame] | 38 | Additional options to the C compiler (for built-in and modules). |
| 39 | |
Sam Ravnborg | 80c00ba | 2010-07-28 19:11:27 +0200 | [diff] [blame] | 40 | CFLAGS_KERNEL |
| 41 | -------------------------------------------------- |
Lucas De Marchi | 25985ed | 2011-03-30 22:57:33 -0300 | [diff] [blame] | 42 | Additional options for $(CC) when used to compile |
Sam Ravnborg | 80c00ba | 2010-07-28 19:11:27 +0200 | [diff] [blame] | 43 | code that is compiled as built-in. |
| 44 | |
Sam Ravnborg | 6588169 | 2010-07-28 17:33:09 +0200 | [diff] [blame] | 45 | CFLAGS_MODULE |
| 46 | -------------------------------------------------- |
Lucas De Marchi | 25985ed | 2011-03-30 22:57:33 -0300 | [diff] [blame] | 47 | Additional module specific options to use for $(CC). |
Sam Ravnborg | 6588169 | 2010-07-28 17:33:09 +0200 | [diff] [blame] | 48 | |
| 49 | LDFLAGS_MODULE |
| 50 | -------------------------------------------------- |
| 51 | Additional options used for $(LD) when linking modules. |
Sam Ravnborg | acc08b5 | 2008-12-29 13:45:52 +0100 | [diff] [blame] | 52 | |
Sam Ravnborg | d27579a | 2012-05-05 10:18:42 +0200 | [diff] [blame] | 53 | LDFLAGS_vmlinux |
| 54 | -------------------------------------------------- |
| 55 | Additional options passed to final link of vmlinux. |
| 56 | |
Sam Ravnborg | acc08b5 | 2008-12-29 13:45:52 +0100 | [diff] [blame] | 57 | KBUILD_VERBOSE |
| 58 | -------------------------------------------------- |
Randy Dunlap | df291fa | 2009-01-08 10:59:34 -0800 | [diff] [blame] | 59 | Set the kbuild verbosity. Can be assigned same values as "V=...". |
Sam Ravnborg | acc08b5 | 2008-12-29 13:45:52 +0100 | [diff] [blame] | 60 | See make help for the full list. |
| 61 | Setting "V=..." takes precedence over KBUILD_VERBOSE. |
| 62 | |
| 63 | KBUILD_EXTMOD |
| 64 | -------------------------------------------------- |
| 65 | Set the directory to look for the kernel source when building external |
| 66 | modules. |
| 67 | The directory can be specified in several ways: |
| 68 | 1) Use "M=..." on the command line |
Nicolas Kaiser | c95940f | 2010-08-05 11:23:11 -0700 | [diff] [blame] | 69 | 2) Environment variable KBUILD_EXTMOD |
| 70 | 3) Environment variable SUBDIRS |
Sam Ravnborg | acc08b5 | 2008-12-29 13:45:52 +0100 | [diff] [blame] | 71 | The possibilities are listed in the order they take precedence. |
| 72 | Using "M=..." will always override the others. |
| 73 | |
| 74 | KBUILD_OUTPUT |
| 75 | -------------------------------------------------- |
| 76 | Specify the output directory when building the kernel. |
Nicolas Kaiser | c95940f | 2010-08-05 11:23:11 -0700 | [diff] [blame] | 77 | The output directory can also be specified using "O=...". |
Randy Dunlap | df291fa | 2009-01-08 10:59:34 -0800 | [diff] [blame] | 78 | Setting "O=..." takes precedence over KBUILD_OUTPUT. |
Sam Ravnborg | acc08b5 | 2008-12-29 13:45:52 +0100 | [diff] [blame] | 79 | |
Asbjoern Sloth Toennesen | 55f88ec | 2010-12-12 17:39:40 +0000 | [diff] [blame] | 80 | KBUILD_DEBARCH |
| 81 | -------------------------------------------------- |
| 82 | For the deb-pkg target, allows overriding the normal heuristics deployed by |
| 83 | deb-pkg. Normally deb-pkg attempts to guess the right architecture based on |
| 84 | the UTS_MACHINE variable, and on some architectures also the kernel config. |
| 85 | The value of KBUILD_DEBARCH is assumed (not checked) to be a valid Debian |
| 86 | architecture. |
| 87 | |
Sam Ravnborg | acc08b5 | 2008-12-29 13:45:52 +0100 | [diff] [blame] | 88 | ARCH |
| 89 | -------------------------------------------------- |
| 90 | Set ARCH to the architecture to be built. |
| 91 | In most cases the name of the architecture is the same as the |
| 92 | directory name found in the arch/ directory. |
Randy Dunlap | df291fa | 2009-01-08 10:59:34 -0800 | [diff] [blame] | 93 | But some architectures such as x86 and sparc have aliases. |
Sam Ravnborg | acc08b5 | 2008-12-29 13:45:52 +0100 | [diff] [blame] | 94 | x86: i386 for 32 bit, x86_64 for 64 bit |
| 95 | sparc: sparc for 32 bit, sparc64 for 64 bit |
| 96 | |
| 97 | CROSS_COMPILE |
| 98 | -------------------------------------------------- |
| 99 | Specify an optional fixed part of the binutils filename. |
| 100 | CROSS_COMPILE can be a part of the filename or the full path. |
| 101 | |
Kirill Smelkov | e8d400a | 2010-02-17 11:45:33 +0300 | [diff] [blame] | 102 | CROSS_COMPILE is also used for ccache in some setups. |
Sam Ravnborg | acc08b5 | 2008-12-29 13:45:52 +0100 | [diff] [blame] | 103 | |
| 104 | CF |
| 105 | -------------------------------------------------- |
| 106 | Additional options for sparse. |
| 107 | CF is often used on the command-line like this: |
| 108 | |
| 109 | make CF=-Wbitwise C=2 |
| 110 | |
| 111 | INSTALL_PATH |
| 112 | -------------------------------------------------- |
| 113 | INSTALL_PATH specifies where to place the updated kernel and system map |
Randy Dunlap | df291fa | 2009-01-08 10:59:34 -0800 | [diff] [blame] | 114 | images. Default is /boot, but you can set it to other values. |
Sam Ravnborg | acc08b5 | 2008-12-29 13:45:52 +0100 | [diff] [blame] | 115 | |
Sam Ravnborg | caa27b6 | 2009-07-20 21:37:11 +0200 | [diff] [blame] | 116 | INSTALLKERNEL |
| 117 | -------------------------------------------------- |
| 118 | Install script called when using "make install". |
| 119 | The default name is "installkernel". |
| 120 | |
| 121 | The script will be called with the following arguments: |
| 122 | $1 - kernel version |
| 123 | $2 - kernel image file |
| 124 | $3 - kernel map file |
| 125 | $4 - default install path (use root directory if blank) |
| 126 | |
Nicolas Kaiser | c95940f | 2010-08-05 11:23:11 -0700 | [diff] [blame] | 127 | The implementation of "make install" is architecture specific |
Sam Ravnborg | caa27b6 | 2009-07-20 21:37:11 +0200 | [diff] [blame] | 128 | and it may differ from the above. |
| 129 | |
| 130 | INSTALLKERNEL is provided to enable the possibility to |
| 131 | specify a custom installer when cross compiling a kernel. |
Sam Ravnborg | acc08b5 | 2008-12-29 13:45:52 +0100 | [diff] [blame] | 132 | |
| 133 | MODLIB |
| 134 | -------------------------------------------------- |
| 135 | Specify where to install modules. |
| 136 | The default value is: |
| 137 | |
| 138 | $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) |
| 139 | |
| 140 | The value can be overridden in which case the default value is ignored. |
| 141 | |
| 142 | INSTALL_MOD_PATH |
| 143 | -------------------------------------------------- |
| 144 | INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory |
| 145 | relocations required by build roots. This is not defined in the |
| 146 | makefile but the argument can be passed to make if needed. |
| 147 | |
| 148 | INSTALL_MOD_STRIP |
| 149 | -------------------------------------------------- |
| 150 | INSTALL_MOD_STRIP, if defined, will cause modules to be |
| 151 | stripped after they are installed. If INSTALL_MOD_STRIP is '1', then |
| 152 | the default option --strip-debug will be used. Otherwise, |
Gilles Espinasse | 177b241 | 2011-01-09 08:59:49 +0100 | [diff] [blame] | 153 | INSTALL_MOD_STRIP value will be used as the options to the strip command. |
Sam Ravnborg | acc08b5 | 2008-12-29 13:45:52 +0100 | [diff] [blame] | 154 | |
| 155 | INSTALL_FW_PATH |
| 156 | -------------------------------------------------- |
Randy Dunlap | df291fa | 2009-01-08 10:59:34 -0800 | [diff] [blame] | 157 | INSTALL_FW_PATH specifies where to install the firmware blobs. |
Sam Ravnborg | acc08b5 | 2008-12-29 13:45:52 +0100 | [diff] [blame] | 158 | The default value is: |
| 159 | |
| 160 | $(INSTALL_MOD_PATH)/lib/firmware |
| 161 | |
| 162 | The value can be overridden in which case the default value is ignored. |
| 163 | |
| 164 | INSTALL_HDR_PATH |
| 165 | -------------------------------------------------- |
Randy Dunlap | df291fa | 2009-01-08 10:59:34 -0800 | [diff] [blame] | 166 | INSTALL_HDR_PATH specifies where to install user space headers when |
Sam Ravnborg | acc08b5 | 2008-12-29 13:45:52 +0100 | [diff] [blame] | 167 | executing "make headers_*". |
| 168 | The default value is: |
| 169 | |
| 170 | $(objtree)/usr |
| 171 | |
| 172 | $(objtree) is the directory where output files are saved. |
| 173 | The output directory is often set using "O=..." on the commandline. |
| 174 | |
| 175 | The value can be overridden in which case the default value is ignored. |
| 176 | |
David Woodhouse | af1eb29 | 2015-07-20 21:16:28 +0100 | [diff] [blame] | 177 | KBUILD_SIGN_PIN |
| 178 | -------------------------------------------------- |
| 179 | This variable allows a passphrase or PIN to be passed to the sign-file |
| 180 | utility when signing kernel modules, if the private key requires such. |
| 181 | |
Sam Ravnborg | acc08b5 | 2008-12-29 13:45:52 +0100 | [diff] [blame] | 182 | KBUILD_MODPOST_WARN |
| 183 | -------------------------------------------------- |
Randy Dunlap | df291fa | 2009-01-08 10:59:34 -0800 | [diff] [blame] | 184 | KBUILD_MODPOST_WARN can be set to avoid errors in case of undefined |
| 185 | symbols in the final module linking stage. It changes such errors |
| 186 | into warnings. |
Sam Ravnborg | acc08b5 | 2008-12-29 13:45:52 +0100 | [diff] [blame] | 187 | |
Randy Dunlap | df291fa | 2009-01-08 10:59:34 -0800 | [diff] [blame] | 188 | KBUILD_MODPOST_NOFINAL |
Sam Ravnborg | acc08b5 | 2008-12-29 13:45:52 +0100 | [diff] [blame] | 189 | -------------------------------------------------- |
| 190 | KBUILD_MODPOST_NOFINAL can be set to skip the final link of modules. |
Randy Dunlap | df291fa | 2009-01-08 10:59:34 -0800 | [diff] [blame] | 191 | This is solely useful to speed up test compiles. |
Sam Ravnborg | acc08b5 | 2008-12-29 13:45:52 +0100 | [diff] [blame] | 192 | |
| 193 | KBUILD_EXTRA_SYMBOLS |
| 194 | -------------------------------------------------- |
Randy Dunlap | df291fa | 2009-01-08 10:59:34 -0800 | [diff] [blame] | 195 | For modules that use symbols from other modules. |
Sam Ravnborg | acc08b5 | 2008-12-29 13:45:52 +0100 | [diff] [blame] | 196 | See more details in modules.txt. |
Jike Song | 4f62824 | 2009-01-05 14:57:03 +0800 | [diff] [blame] | 197 | |
| 198 | ALLSOURCE_ARCHS |
| 199 | -------------------------------------------------- |
Randy Dunlap | df291fa | 2009-01-08 10:59:34 -0800 | [diff] [blame] | 200 | For tags/TAGS/cscope targets, you can specify more than one arch |
| 201 | to be included in the databases, separated by blank space. E.g.: |
Jike Song | 4f62824 | 2009-01-05 14:57:03 +0800 | [diff] [blame] | 202 | |
| 203 | $ make ALLSOURCE_ARCHS="x86 mips arm" tags |
John Kacur | bc75cc6 | 2010-03-02 16:57:52 +0100 | [diff] [blame] | 204 | |
| 205 | To get all available archs you can also specify all. E.g.: |
| 206 | |
| 207 | $ make ALLSOURCE_ARCHS=all tags |
Borislav Petkov | 4a5838a | 2011-03-01 09:35:29 +0100 | [diff] [blame] | 208 | |
| 209 | KBUILD_ENABLE_EXTRA_GCC_CHECKS |
| 210 | -------------------------------------------------- |
| 211 | If enabled over the make command line with "W=1", it turns on additional |
| 212 | gcc -W... options for more extensive build-time checking. |
Michal Marek | 53e6892 | 2011-04-05 14:32:30 +0200 | [diff] [blame] | 213 | |
| 214 | KBUILD_BUILD_TIMESTAMP |
| 215 | -------------------------------------------------- |
| 216 | Setting this to a date string overrides the timestamp used in the |
Michal Marek | a8b8017 | 2011-03-31 23:16:42 +0200 | [diff] [blame] | 217 | UTS_VERSION definition (uname -v in the running kernel). The value has to |
| 218 | be a string that can be passed to date -d. The default value |
Michal Marek | 53e6892 | 2011-04-05 14:32:30 +0200 | [diff] [blame] | 219 | is the output of the date command at one point during build. |
| 220 | |
| 221 | KBUILD_BUILD_USER, KBUILD_BUILD_HOST |
| 222 | -------------------------------------------------- |
| 223 | These two variables allow to override the user@host string displayed during |
| 224 | boot and in /proc/version. The default value is the output of the commands |
| 225 | whoami and host, respectively. |
Sam Ravnborg | d27579a | 2012-05-05 10:18:42 +0200 | [diff] [blame] | 226 | |
| 227 | KBUILD_LDS |
| 228 | -------------------------------------------------- |
| 229 | The linker script with full path. Assigned by the top-level Makefile. |
| 230 | |
| 231 | KBUILD_VMLINUX_INIT |
| 232 | -------------------------------------------------- |
| 233 | All object files for the init (first) part of vmlinux. |
| 234 | Files specified with KBUILD_VMLINUX_INIT are linked first. |
| 235 | |
| 236 | KBUILD_VMLINUX_MAIN |
| 237 | -------------------------------------------------- |
| 238 | All object files for the main part of vmlinux. |
| 239 | KBUILD_VMLINUX_INIT and KBUILD_VMLINUX_MAIN together specify |
| 240 | all the object files used to link vmlinux. |