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