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