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