Merge branch 'viafb-next' of git://github.com/schandinat/linux-2.6
[pandora-kernel.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 Addtional module specific options to use for $(AS).
30
31 AFLAGS_KERNEL
32 --------------------------------------------------
33 Addtional 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 Addtional options for $(CC) when used to compile
43 code that is compiled as built-in.
44
45 CFLAGS_MODULE
46 --------------------------------------------------
47 Addtional module specific options to use for $(CC).
48
49 LDFLAGS_MODULE
50 --------------------------------------------------
51 Additional options used for $(LD) when linking modules.
52
53 KBUILD_VERBOSE
54 --------------------------------------------------
55 Set the kbuild verbosity. Can be assigned same values as "V=...".
56 See make help for the full list.
57 Setting "V=..." takes precedence over KBUILD_VERBOSE.
58
59 KBUILD_EXTMOD
60 --------------------------------------------------
61 Set the directory to look for the kernel source when building external
62 modules.
63 The directory can be specified in several ways:
64 1) Use "M=..." on the command line
65 2) Environment variable KBUILD_EXTMOD
66 3) Environment variable SUBDIRS
67 The possibilities are listed in the order they take precedence.
68 Using "M=..." will always override the others.
69
70 KBUILD_OUTPUT
71 --------------------------------------------------
72 Specify the output directory when building the kernel.
73 The output directory can also be specified using "O=...".
74 Setting "O=..." takes precedence over KBUILD_OUTPUT.
75
76 ARCH
77 --------------------------------------------------
78 Set ARCH to the architecture to be built.
79 In most cases the name of the architecture is the same as the
80 directory name found in the arch/ directory.
81 But some architectures such as x86 and sparc have aliases.
82 x86: i386 for 32 bit, x86_64 for 64 bit
83 sparc: sparc for 32 bit, sparc64 for 64 bit
84
85 CROSS_COMPILE
86 --------------------------------------------------
87 Specify an optional fixed part of the binutils filename.
88 CROSS_COMPILE can be a part of the filename or the full path.
89
90 CROSS_COMPILE is also used for ccache in some setups.
91
92 CF
93 --------------------------------------------------
94 Additional options for sparse.
95 CF is often used on the command-line like this:
96
97     make CF=-Wbitwise C=2
98
99 INSTALL_PATH
100 --------------------------------------------------
101 INSTALL_PATH specifies where to place the updated kernel and system map
102 images. Default is /boot, but you can set it to other values.
103
104 INSTALLKERNEL
105 --------------------------------------------------
106 Install script called when using "make install".
107 The default name is "installkernel".
108
109 The script will be called with the following arguments:
110     $1 - kernel version
111     $2 - kernel image file
112     $3 - kernel map file
113     $4 - default install path (use root directory if blank)
114
115 The implementation of "make install" is architecture specific
116 and it may differ from the above.
117
118 INSTALLKERNEL is provided to enable the possibility to
119 specify a custom installer when cross compiling a kernel.
120
121 MODLIB
122 --------------------------------------------------
123 Specify where to install modules.
124 The default value is:
125
126      $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
127
128 The value can be overridden in which case the default value is ignored.
129
130 INSTALL_MOD_PATH
131 --------------------------------------------------
132 INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
133 relocations required by build roots.  This is not defined in the
134 makefile but the argument can be passed to make if needed.
135
136 INSTALL_MOD_STRIP
137 --------------------------------------------------
138 INSTALL_MOD_STRIP, if defined, will cause modules to be
139 stripped after they are installed.  If INSTALL_MOD_STRIP is '1', then
140 the default option --strip-debug will be used.  Otherwise,
141 INSTALL_MOD_STRIP will used as the options to the strip command.
142
143 INSTALL_FW_PATH
144 --------------------------------------------------
145 INSTALL_FW_PATH specifies where to install the firmware blobs.
146 The default value is:
147
148     $(INSTALL_MOD_PATH)/lib/firmware
149
150 The value can be overridden in which case the default value is ignored.
151
152 INSTALL_HDR_PATH
153 --------------------------------------------------
154 INSTALL_HDR_PATH specifies where to install user space headers when
155 executing "make headers_*".
156 The default value is:
157
158     $(objtree)/usr
159
160 $(objtree) is the directory where output files are saved.
161 The output directory is often set using "O=..." on the commandline.
162
163 The value can be overridden in which case the default value is ignored.
164
165 KBUILD_MODPOST_WARN
166 --------------------------------------------------
167 KBUILD_MODPOST_WARN can be set to avoid errors in case of undefined
168 symbols in the final module linking stage. It changes such errors
169 into warnings.
170
171 KBUILD_MODPOST_NOFINAL
172 --------------------------------------------------
173 KBUILD_MODPOST_NOFINAL can be set to skip the final link of modules.
174 This is solely useful to speed up test compiles.
175
176 KBUILD_EXTRA_SYMBOLS
177 --------------------------------------------------
178 For modules that use symbols from other modules.
179 See more details in modules.txt.
180
181 ALLSOURCE_ARCHS
182 --------------------------------------------------
183 For tags/TAGS/cscope targets, you can specify more than one arch
184 to be included in the databases, separated by blank space. E.g.:
185
186     $ make ALLSOURCE_ARCHS="x86 mips arm" tags
187
188 To get all available archs you can also specify all. E.g.:
189
190     $ make ALLSOURCE_ARCHS=all tags