]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blame - Documentation/kbuild/kbuild.txt
Merge branch 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[mirror_ubuntu-zesty-kernel.git] / Documentation / kbuild / kbuild.txt
CommitLineData
acc08b51
SR
1Environment variables
2
3KCPPFLAGS
4--------------------------------------------------
5Additional options to pass when preprocessing. The preprocessing options
df291fa9 6will be used in all cases where kbuild does preprocessing including
acc08b51
SR
7building C files and assembler files.
8
9KAFLAGS
10--------------------------------------------------
11Additional options to the assembler.
12
13KCFLAGS
14--------------------------------------------------
15Additional options to the C compiler.
16
17KBUILD_VERBOSE
18--------------------------------------------------
df291fa9 19Set the kbuild verbosity. Can be assigned same values as "V=...".
acc08b51
SR
20See make help for the full list.
21Setting "V=..." takes precedence over KBUILD_VERBOSE.
22
23KBUILD_EXTMOD
24--------------------------------------------------
25Set the directory to look for the kernel source when building external
26modules.
27The directory can be specified in several ways:
281) Use "M=..." on the command line
292) Environmnet variable KBUILD_EXTMOD
303) Environmnet variable SUBDIRS
31The possibilities are listed in the order they take precedence.
32Using "M=..." will always override the others.
33
34KBUILD_OUTPUT
35--------------------------------------------------
36Specify the output directory when building the kernel.
37The output directory can also be specificed using "O=...".
df291fa9 38Setting "O=..." takes precedence over KBUILD_OUTPUT.
acc08b51
SR
39
40ARCH
41--------------------------------------------------
42Set ARCH to the architecture to be built.
43In most cases the name of the architecture is the same as the
44directory name found in the arch/ directory.
df291fa9 45But some architectures such as x86 and sparc have aliases.
acc08b51
SR
46x86: i386 for 32 bit, x86_64 for 64 bit
47sparc: sparc for 32 bit, sparc64 for 64 bit
48
49CROSS_COMPILE
50--------------------------------------------------
51Specify an optional fixed part of the binutils filename.
52CROSS_COMPILE can be a part of the filename or the full path.
53
54CROSS_COMPILE is also used for ccache is some setups.
55
56CF
57--------------------------------------------------
58Additional options for sparse.
59CF is often used on the command-line like this:
60
61 make CF=-Wbitwise C=2
62
63INSTALL_PATH
64--------------------------------------------------
65INSTALL_PATH specifies where to place the updated kernel and system map
df291fa9 66images. Default is /boot, but you can set it to other values.
acc08b51
SR
67
68
69MODLIB
70--------------------------------------------------
71Specify where to install modules.
72The default value is:
73
74 $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
75
76The value can be overridden in which case the default value is ignored.
77
78INSTALL_MOD_PATH
79--------------------------------------------------
80INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
81relocations required by build roots. This is not defined in the
82makefile but the argument can be passed to make if needed.
83
84INSTALL_MOD_STRIP
85--------------------------------------------------
86INSTALL_MOD_STRIP, if defined, will cause modules to be
87stripped after they are installed. If INSTALL_MOD_STRIP is '1', then
88the default option --strip-debug will be used. Otherwise,
89INSTALL_MOD_STRIP will used as the options to the strip command.
90
91INSTALL_FW_PATH
92--------------------------------------------------
df291fa9 93INSTALL_FW_PATH specifies where to install the firmware blobs.
acc08b51
SR
94The default value is:
95
96 $(INSTALL_MOD_PATH)/lib/firmware
97
98The value can be overridden in which case the default value is ignored.
99
100INSTALL_HDR_PATH
101--------------------------------------------------
df291fa9 102INSTALL_HDR_PATH specifies where to install user space headers when
acc08b51
SR
103executing "make headers_*".
104The default value is:
105
106 $(objtree)/usr
107
108$(objtree) is the directory where output files are saved.
109The output directory is often set using "O=..." on the commandline.
110
111The value can be overridden in which case the default value is ignored.
112
113KBUILD_MODPOST_WARN
114--------------------------------------------------
df291fa9
RD
115KBUILD_MODPOST_WARN can be set to avoid errors in case of undefined
116symbols in the final module linking stage. It changes such errors
117into warnings.
acc08b51 118
df291fa9 119KBUILD_MODPOST_NOFINAL
acc08b51
SR
120--------------------------------------------------
121KBUILD_MODPOST_NOFINAL can be set to skip the final link of modules.
df291fa9 122This is solely useful to speed up test compiles.
acc08b51
SR
123
124KBUILD_EXTRA_SYMBOLS
125--------------------------------------------------
df291fa9 126For modules that use symbols from other modules.
acc08b51 127See more details in modules.txt.
4f628248
JS
128
129ALLSOURCE_ARCHS
130--------------------------------------------------
df291fa9
RD
131For tags/TAGS/cscope targets, you can specify more than one arch
132to be included in the databases, separated by blank space. E.g.:
4f628248
JS
133
134 $ make ALLSOURCE_ARCHS="x86 mips arm" tags