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