Contents
How are Makefiles used in the Linux kernel?
The kbuild Makefile uses information from the .config file to construct various file lists used by kbuild to build any built-in or modular targets. scripts/Makefile.* contains all the definitions/rules etc. that are used to build the kernel based on the kbuild makefiles.
Which is the correct name for a makefile file?
The preferred name for the kbuild files are ‘Makefile’ but ‘Kbuild’ can be used and if both a ‘Makefile’ and a ‘Kbuild’ file exists, then the ‘Kbuild’ file will be used. Section 3.1 “Goal definitions” is a quick intro; further chapters provide more details, with real examples.
Who are the developers of the Linux kernel?
Kbuild developers are people who work on the kernel build system itself. These people need to know about all aspects of the kernel Makefiles. This document is aimed towards normal developers and arch developers. Most Makefiles within the kernel are kbuild Makefiles that use the kbuild infrastructure.
Which is the Makefile for vmlinux in Linux?
$ (CONFIG_FOO) evaluates to either y (for built-in) or m (for module). If CONFIG_FOO is neither y nor m, then the file will not be compiled nor linked. The kbuild Makefile specifies object files for vmlinux in the $ (obj-y) lists. These lists depend on the kernel configuration.
What does Linux kernel’s ` make defconfig’do?
When .config file is being generated, kernel build system goes through all Kconfig files (from all subdirs), checking all options in those Kconfig files: Check scripts/kconfig/Makefile and scripts/kconfig/conf.c files to see how it’s actually done. From “Kbuild: the Linux Kernel Build System” by Javier Martinez:
When to use make savedefconfig rule in Linux?
Instead you should use make savedefconfig rule. When .config file is being generated, kernel build system goes through all Kconfig files (from all subdirs), checking all options in those Kconfig files: Check scripts/kconfig/Makefile and scripts/kconfig/conf.c files to see how it’s actually done.
Where is the Kconfig file in the Linux kernel?
On top of the kernel source code directory, there is a Kconfig file that is the root of the options tree. The menuconfig ( scripts/kconfig/mconf ), gconfig ( scripts/kconfig/gconf) and other compile targets invoke programs that start at this root Kconfig and recursively read the Kconfig files located in each subdirectory to build their menus.