39ceda5ce1
- remove headers_{install,check}_all targets - remove unreasonable 'depends on !UML' from CONFIG_SAMPLES - re-implement 'make headers_install' more cleanly - add new header-test-y syntax to compile-test headers - compile-test exported headers to ensure they are compilable in user-space - compile-test headers under include/ to ensure they are self-contained - remove -Waggregate-return, -Wno-uninitialized, -Wno-unused-value flags - add -Werror=unknown-warning-option for Clang - add 128-bit built-in types support to genksyms - fix missed rebuild of modules.builtin - propagate 'No space left on device' error in fixdep to Make - allow Clang to use its integrated assembler - improve some coccinelle scripts - add a new flag KBUILD_ABS_SRCTREE to request Kbuild to use absolute path for $(srctree). - do not ignore errors when compression utility is missing - misc cleanups -----BEGIN PGP SIGNATURE----- iQJSBAABCgA8FiEEbmPs18K1szRHjPqEPYsBB53g2wYFAl0oxNkeHHlhbWFkYS5t YXNhaGlyb0Bzb2Npb25leHQuY29tAAoJED2LAQed4NsGnhcP/AuM8s+3SYFiLitJ ISbznLFP2Xatq0SPXp5+moez/AMTK6Mm1biPcdo20d+TjVEh4+9F2nq12Ii9U8/D tds9A6G8+Bb28r9GMIVQPdFohijW6ijtDziS31iQnIWyPsP/yx6PKfLAD9F4ca1x 7/4btmu+BOMjtN0NrMWSNz5MM47xUzoWIALL40SV4PzGVXLCQZ2PBNPeSRIk22Jt ynDNPuNsmDWcFfwAE+sLSDrhCHZlwM8rg8rf6jmYdc4LcN4cj0oho5+K1TRyC9mn fO3PT25juFejthxQulxEfyGggnyLM6BNTgPDGcCHSP4nD7mlXA9GcpZICtJOgGGu SlDadMZ0GRMK5zcZ0MF0GQboeyViwsbXgrRcYuXt6cUFWX4P/1SeAQ5Mf4u1EKqf hEbwFXV/g81ht0lFS8gyWkvdpoNPtxGHNPusLjp65C4rc0/48/s+7EE/u8JTPl1g dQTeIOds6XUOkJgqhEfuq+8gfngbjKc9bYhs+ACbkCzBltQdnb6m5aLgk0ODxe8I WbGn0+cQcS9VVwre7E5DnFSVWVOHAG5taiUwj0KDcHB0Jxw9Gvorq9WU1ppHHYH2 XQIFBx7XHdn28d+plS8R23vAPgDgrGdvE5RYK5tNQLhTJ6BbjlZ1n/Tmxzu62scK deG3aCOB13Om7OTzTUh9+C3TC9ZQ =E2Rz -----END PGP SIGNATURE----- Merge tag 'kbuild-v5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild updates from Masahiro Yamada: - remove headers_{install,check}_all targets - remove unreasonable 'depends on !UML' from CONFIG_SAMPLES - re-implement 'make headers_install' more cleanly - add new header-test-y syntax to compile-test headers - compile-test exported headers to ensure they are compilable in user-space - compile-test headers under include/ to ensure they are self-contained - remove -Waggregate-return, -Wno-uninitialized, -Wno-unused-value flags - add -Werror=unknown-warning-option for Clang - add 128-bit built-in types support to genksyms - fix missed rebuild of modules.builtin - propagate 'No space left on device' error in fixdep to Make - allow Clang to use its integrated assembler - improve some coccinelle scripts - add a new flag KBUILD_ABS_SRCTREE to request Kbuild to use absolute path for $(srctree). - do not ignore errors when compression utility is missing - misc cleanups * tag 'kbuild-v5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (49 commits) kbuild: use -- separater intead of $(filter-out ...) for cc-cross-prefix kbuild: Inform user to pass ARCH= for make mrproper kbuild: fix compression errors getting ignored kbuild: add a flag to force absolute path for srctree kbuild: replace KBUILD_SRCTREE with boolean building_out_of_srctree kbuild: remove src and obj from the top Makefile scripts/tags.sh: remove unused environment variables from comments scripts/tags.sh: drop SUBARCH support for ARM kbuild: compile-test kernel headers to ensure they are self-contained kheaders: include only headers into kheaders_data.tar.xz kheaders: remove meaningless -R option of 'ls' kbuild: support header-test-pattern-y kbuild: do not create wrappers for header-test-y kbuild: compile-test exported headers to ensure they are self-contained init/Kconfig: add CONFIG_CC_CAN_LINK kallsyms: exclude kasan local symbols on s390 kbuild: add more hints about SUBDIRS replacement coccinelle: api/stream_open: treat all wait_.*() calls as blocking coccinelle: put_device: Add a cast to an expression for an assignment coccinelle: put_device: Adjust a message construction ...
275 lines
7.7 KiB
ReStructuredText
275 lines
7.7 KiB
ReStructuredText
======
|
|
Kbuild
|
|
======
|
|
|
|
|
|
Output files
|
|
============
|
|
|
|
modules.order
|
|
-------------
|
|
This file records the order in which modules appear in Makefiles. This
|
|
is used by modprobe to deterministically resolve aliases that match
|
|
multiple modules.
|
|
|
|
modules.builtin
|
|
---------------
|
|
This file lists all modules that are built into the kernel. This is used
|
|
by modprobe to not fail when trying to load something builtin.
|
|
|
|
modules.builtin.modinfo
|
|
--------------------------------------------------
|
|
This file contains modinfo from all modules that are built into the kernel.
|
|
Unlike modinfo of a separate module, all fields are prefixed with module name.
|
|
|
|
|
|
Environment variables
|
|
=====================
|
|
|
|
KCPPFLAGS
|
|
---------
|
|
Additional options to pass when preprocessing. The preprocessing options
|
|
will be used in all cases where kbuild does preprocessing including
|
|
building C files and assembler files.
|
|
|
|
KAFLAGS
|
|
-------
|
|
Additional options to the assembler (for built-in and modules).
|
|
|
|
AFLAGS_MODULE
|
|
-------------
|
|
Additional module specific options to use for $(AS).
|
|
|
|
AFLAGS_KERNEL
|
|
-------------
|
|
Additional options for $(AS) when used for assembler
|
|
code for code that is compiled as built-in.
|
|
|
|
KCFLAGS
|
|
-------
|
|
Additional options to the C compiler (for built-in and modules).
|
|
|
|
CFLAGS_KERNEL
|
|
-------------
|
|
Additional options for $(CC) when used to compile
|
|
code that is compiled as built-in.
|
|
|
|
CFLAGS_MODULE
|
|
-------------
|
|
Additional module specific options to use for $(CC).
|
|
|
|
LDFLAGS_MODULE
|
|
--------------
|
|
Additional options used for $(LD) when linking modules.
|
|
|
|
HOSTCFLAGS
|
|
----------
|
|
Additional flags to be passed to $(HOSTCC) when building host programs.
|
|
|
|
HOSTCXXFLAGS
|
|
------------
|
|
Additional flags to be passed to $(HOSTCXX) when building host programs.
|
|
|
|
HOSTLDFLAGS
|
|
-----------
|
|
Additional flags to be passed when linking host programs.
|
|
|
|
HOSTLDLIBS
|
|
----------
|
|
Additional libraries to link against when building host programs.
|
|
|
|
KBUILD_KCONFIG
|
|
--------------
|
|
Set the top-level Kconfig file to the value of this environment
|
|
variable. The default name is "Kconfig".
|
|
|
|
KBUILD_VERBOSE
|
|
--------------
|
|
Set the kbuild verbosity. Can be assigned same values as "V=...".
|
|
|
|
See make help for the full list.
|
|
|
|
Setting "V=..." takes precedence over KBUILD_VERBOSE.
|
|
|
|
KBUILD_EXTMOD
|
|
-------------
|
|
Set the directory to look for the kernel source when building external
|
|
modules.
|
|
|
|
Setting "M=..." takes precedence over KBUILD_EXTMOD.
|
|
|
|
KBUILD_OUTPUT
|
|
-------------
|
|
Specify the output directory when building the kernel.
|
|
|
|
The output directory can also be specified using "O=...".
|
|
|
|
Setting "O=..." takes precedence over KBUILD_OUTPUT.
|
|
|
|
KBUILD_DEBARCH
|
|
--------------
|
|
For the deb-pkg target, allows overriding the normal heuristics deployed by
|
|
deb-pkg. Normally deb-pkg attempts to guess the right architecture based on
|
|
the UTS_MACHINE variable, and on some architectures also the kernel config.
|
|
The value of KBUILD_DEBARCH is assumed (not checked) to be a valid Debian
|
|
architecture.
|
|
|
|
ARCH
|
|
----
|
|
Set ARCH to the architecture to be built.
|
|
|
|
In most cases the name of the architecture is the same as the
|
|
directory name found in the arch/ directory.
|
|
|
|
But some architectures such as x86 and sparc have aliases.
|
|
|
|
- x86: i386 for 32 bit, x86_64 for 64 bit
|
|
- sh: sh for 32 bit, sh64 for 64 bit
|
|
- sparc: sparc32 for 32 bit, sparc64 for 64 bit
|
|
|
|
CROSS_COMPILE
|
|
-------------
|
|
Specify an optional fixed part of the binutils filename.
|
|
CROSS_COMPILE can be a part of the filename or the full path.
|
|
|
|
CROSS_COMPILE is also used for ccache in some setups.
|
|
|
|
CF
|
|
--
|
|
Additional options for sparse.
|
|
|
|
CF is often used on the command-line like this::
|
|
|
|
make CF=-Wbitwise C=2
|
|
|
|
INSTALL_PATH
|
|
------------
|
|
INSTALL_PATH specifies where to place the updated kernel and system map
|
|
images. Default is /boot, but you can set it to other values.
|
|
|
|
INSTALLKERNEL
|
|
-------------
|
|
Install script called when using "make install".
|
|
The default name is "installkernel".
|
|
|
|
The script will be called with the following arguments:
|
|
- $1 - kernel version
|
|
- $2 - kernel image file
|
|
- $3 - kernel map file
|
|
- $4 - default install path (use root directory if blank)
|
|
|
|
The implementation of "make install" is architecture specific
|
|
and it may differ from the above.
|
|
|
|
INSTALLKERNEL is provided to enable the possibility to
|
|
specify a custom installer when cross compiling a kernel.
|
|
|
|
MODLIB
|
|
------
|
|
Specify where to install modules.
|
|
The default value is::
|
|
|
|
$(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
|
|
|
|
The value can be overridden in which case the default value is ignored.
|
|
|
|
INSTALL_MOD_PATH
|
|
----------------
|
|
INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
|
|
relocations required by build roots. This is not defined in the
|
|
makefile but the argument can be passed to make if needed.
|
|
|
|
INSTALL_MOD_STRIP
|
|
-----------------
|
|
INSTALL_MOD_STRIP, if defined, will cause modules to be
|
|
stripped after they are installed. If INSTALL_MOD_STRIP is '1', then
|
|
the default option --strip-debug will be used. Otherwise,
|
|
INSTALL_MOD_STRIP value will be used as the options to the strip command.
|
|
|
|
INSTALL_HDR_PATH
|
|
----------------
|
|
INSTALL_HDR_PATH specifies where to install user space headers when
|
|
executing "make headers_*".
|
|
|
|
The default value is::
|
|
|
|
$(objtree)/usr
|
|
|
|
$(objtree) is the directory where output files are saved.
|
|
The output directory is often set using "O=..." on the commandline.
|
|
|
|
The value can be overridden in which case the default value is ignored.
|
|
|
|
KBUILD_ABS_SRCTREE
|
|
--------------------------------------------------
|
|
Kbuild uses a relative path to point to the tree when possible. For instance,
|
|
when building in the source tree, the source tree path is '.'
|
|
|
|
Setting this flag requests Kbuild to use absolute path to the source tree.
|
|
There are some useful cases to do so, like when generating tag files with
|
|
absolute path entries etc.
|
|
|
|
KBUILD_SIGN_PIN
|
|
---------------
|
|
This variable allows a passphrase or PIN to be passed to the sign-file
|
|
utility when signing kernel modules, if the private key requires such.
|
|
|
|
KBUILD_MODPOST_WARN
|
|
-------------------
|
|
KBUILD_MODPOST_WARN can be set to avoid errors in case of undefined
|
|
symbols in the final module linking stage. It changes such errors
|
|
into warnings.
|
|
|
|
KBUILD_MODPOST_NOFINAL
|
|
----------------------
|
|
KBUILD_MODPOST_NOFINAL can be set to skip the final link of modules.
|
|
This is solely useful to speed up test compiles.
|
|
|
|
KBUILD_EXTRA_SYMBOLS
|
|
--------------------
|
|
For modules that use symbols from other modules.
|
|
See more details in modules.txt.
|
|
|
|
ALLSOURCE_ARCHS
|
|
---------------
|
|
For tags/TAGS/cscope targets, you can specify more than one arch
|
|
to be included in the databases, separated by blank space. E.g.::
|
|
|
|
$ make ALLSOURCE_ARCHS="x86 mips arm" tags
|
|
|
|
To get all available archs you can also specify all. E.g.::
|
|
|
|
$ make ALLSOURCE_ARCHS=all tags
|
|
|
|
KBUILD_ENABLE_EXTRA_GCC_CHECKS
|
|
------------------------------
|
|
If enabled over the make command line with "W=1", it turns on additional
|
|
gcc -W... options for more extensive build-time checking.
|
|
|
|
KBUILD_BUILD_TIMESTAMP
|
|
----------------------
|
|
Setting this to a date string overrides the timestamp used in the
|
|
UTS_VERSION definition (uname -v in the running kernel). The value has to
|
|
be a string that can be passed to date -d. The default value
|
|
is the output of the date command at one point during build.
|
|
|
|
KBUILD_BUILD_USER, KBUILD_BUILD_HOST
|
|
------------------------------------
|
|
These two variables allow to override the user@host string displayed during
|
|
boot and in /proc/version. The default value is the output of the commands
|
|
whoami and host, respectively.
|
|
|
|
KBUILD_LDS
|
|
----------
|
|
The linker script with full path. Assigned by the top-level Makefile.
|
|
|
|
KBUILD_VMLINUX_OBJS
|
|
-------------------
|
|
All object files for vmlinux. They are linked to vmlinux in the same
|
|
order as listed in KBUILD_VMLINUX_OBJS.
|
|
|
|
KBUILD_VMLINUX_LIBS
|
|
-------------------
|
|
All .a "lib" files for vmlinux. KBUILD_VMLINUX_OBJS and KBUILD_VMLINUX_LIBS
|
|
together specify all the object files used to link vmlinux.
|