Makefile
in the root of the Linux kernel source tree is essentially used to build vmlinux
(the resident kernel image), and
Documentation/output
from files under Documentation/
)
Makefile
includes arch/$SRCARCH/Makefile
which supplies architecture-specific information to the top Makefile
. Makefile
defines a few version related variables: VERSION = 6 PATCHLEVEL = 5 SUBLEVEL = 0 EXTRAVERSION = -rc7 NAME = Hurr durr I'ma ninja sloth
$ make -s kernelversion 6.5.0-rc7
include/config/kernel.release
(if it exists) and include/generated/uapi/linux/version.h
(if it exists). scripts/Kbuild.include | Definition of convenience variables such as comma , quote etc., comparison macros (test-ge , test-lt ) and more such stuff |
scripts/subarch.include | Assign value to SUBARCH |
scripts/Makefile.clang | if CC_VERSION_TEXT contains clang |
scripts/Makefile.compiler | If need-compiler is defined |
arch/$(SRCARCH)/Makefile | For example arch/x86/Makefile |
include/config/auto.conf | If need-config is defined. |
scripts/Makefile.extrawarn | |
scripts/Makefile.debug | if CONFIG_DEBUG_INFO = y |
scripts/Makefile.btf | if CONFIG_DEBUG_INFO_BTF = y |
scripts/Makefile.kasan | if CONFIG_KASAN = y |
scripts/Makefile.kcsan | if CONFIG_KCSAN = y |
scripts/Makefile.kmsan | if CONFIG_KMSAN = y |
scripts/Makefile.ubsan | if CONFIG_UBSAN = y |
scripts/Makefile.kcov | if CONFIG_KCOV = y |
scripts/Makefile.randstruct | if CONFIG_RANDSTRUCT = y |
scripts/Makefile.gcc-plugins | if CONFIG_GCC_PLUGINS = y |
Makefile
includes include/config/auto.conf.cmd
$ make [target]
Documentation/kbuild/makefiles.rst