kbuild: generate modules.builtin
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / Documentation / kbuild / kbuild.txt
CommitLineData
bc081dd6
MM
1Output files
2
3modules.order
4--------------------------------------------------
5This file records the order in which modules appear in Makefiles. This
6is used by modprobe to deterministically resolve aliases that match
7multiple modules.
8
9modules.builtin
10--------------------------------------------------
11This file lists all modules that are built into the kernel. This is used
12by modprobe to not fail when trying to load something builtin.
13
14
acc08b51
SR
15Environment variables
16
17KCPPFLAGS
18--------------------------------------------------
19Additional options to pass when preprocessing. The preprocessing options
df291fa9 20will be used in all cases where kbuild does preprocessing including
acc08b51
SR
21building C files and assembler files.
22
23KAFLAGS
24--------------------------------------------------
25Additional options to the assembler.
26
27KCFLAGS
28--------------------------------------------------
29Additional options to the C compiler.
30
31KBUILD_VERBOSE
32--------------------------------------------------
df291fa9 33Set the kbuild verbosity. Can be assigned same values as "V=...".
acc08b51
SR
34See make help for the full list.
35Setting "V=..." takes precedence over KBUILD_VERBOSE.
36
37KBUILD_EXTMOD
38--------------------------------------------------
39Set the directory to look for the kernel source when building external
40modules.
41The directory can be specified in several ways:
421) Use "M=..." on the command line
432) Environmnet variable KBUILD_EXTMOD
443) Environmnet variable SUBDIRS
45The possibilities are listed in the order they take precedence.
46Using "M=..." will always override the others.
47
48KBUILD_OUTPUT
49--------------------------------------------------
50Specify the output directory when building the kernel.
51The output directory can also be specificed using "O=...".
df291fa9 52Setting "O=..." takes precedence over KBUILD_OUTPUT.
acc08b51
SR
53
54ARCH
55--------------------------------------------------
56Set ARCH to the architecture to be built.
57In most cases the name of the architecture is the same as the
58directory name found in the arch/ directory.
df291fa9 59But some architectures such as x86 and sparc have aliases.
acc08b51
SR
60x86: i386 for 32 bit, x86_64 for 64 bit
61sparc: sparc for 32 bit, sparc64 for 64 bit
62
63CROSS_COMPILE
64--------------------------------------------------
65Specify an optional fixed part of the binutils filename.
66CROSS_COMPILE can be a part of the filename or the full path.
67
68CROSS_COMPILE is also used for ccache is some setups.
69
70CF
71--------------------------------------------------
72Additional options for sparse.
73CF is often used on the command-line like this:
74
75 make CF=-Wbitwise C=2
76
77INSTALL_PATH
78--------------------------------------------------
79INSTALL_PATH specifies where to place the updated kernel and system map
df291fa9 80images. Default is /boot, but you can set it to other values.
acc08b51 81
caa27b66
SR
82INSTALLKERNEL
83--------------------------------------------------
84Install script called when using "make install".
85The default name is "installkernel".
86
87The script will be called with the following arguments:
88 $1 - kernel version
89 $2 - kernel image file
90 $3 - kernel map file
91 $4 - default install path (use root directory if blank)
92
93The implmentation of "make install" is architecture specific
94and it may differ from the above.
95
96INSTALLKERNEL is provided to enable the possibility to
97specify a custom installer when cross compiling a kernel.
acc08b51
SR
98
99MODLIB
100--------------------------------------------------
101Specify where to install modules.
102The default value is:
103
104 $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
105
106The value can be overridden in which case the default value is ignored.
107
108INSTALL_MOD_PATH
109--------------------------------------------------
110INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
111relocations required by build roots. This is not defined in the
112makefile but the argument can be passed to make if needed.
113
114INSTALL_MOD_STRIP
115--------------------------------------------------
116INSTALL_MOD_STRIP, if defined, will cause modules to be
117stripped after they are installed. If INSTALL_MOD_STRIP is '1', then
118the default option --strip-debug will be used. Otherwise,
119INSTALL_MOD_STRIP will used as the options to the strip command.
120
121INSTALL_FW_PATH
122--------------------------------------------------
df291fa9 123INSTALL_FW_PATH specifies where to install the firmware blobs.
acc08b51
SR
124The default value is:
125
126 $(INSTALL_MOD_PATH)/lib/firmware
127
128The value can be overridden in which case the default value is ignored.
129
130INSTALL_HDR_PATH
131--------------------------------------------------
df291fa9 132INSTALL_HDR_PATH specifies where to install user space headers when
acc08b51
SR
133executing "make headers_*".
134The default value is:
135
136 $(objtree)/usr
137
138$(objtree) is the directory where output files are saved.
139The output directory is often set using "O=..." on the commandline.
140
141The value can be overridden in which case the default value is ignored.
142
143KBUILD_MODPOST_WARN
144--------------------------------------------------
df291fa9
RD
145KBUILD_MODPOST_WARN can be set to avoid errors in case of undefined
146symbols in the final module linking stage. It changes such errors
147into warnings.
acc08b51 148
df291fa9 149KBUILD_MODPOST_NOFINAL
acc08b51
SR
150--------------------------------------------------
151KBUILD_MODPOST_NOFINAL can be set to skip the final link of modules.
df291fa9 152This is solely useful to speed up test compiles.
acc08b51
SR
153
154KBUILD_EXTRA_SYMBOLS
155--------------------------------------------------
df291fa9 156For modules that use symbols from other modules.
acc08b51 157See more details in modules.txt.
4f628248
JS
158
159ALLSOURCE_ARCHS
160--------------------------------------------------
df291fa9
RD
161For tags/TAGS/cscope targets, you can specify more than one arch
162to be included in the databases, separated by blank space. E.g.:
4f628248
JS
163
164 $ make ALLSOURCE_ARCHS="x86 mips arm" tags