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