-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Mastering Embedded Linux Development
By :

The kernel build system (Kbuild
) is a set of make
scripts that take the configuration information from the .config
file, work out the dependencies, and compile everything necessary to produce a kernel image. This kernel image contains all the statically linked components, an optional device tree binary, and any kernel modules. The dependencies are expressed within Makefiles inside each directory with buildable components. For instance, the following two lines are taken from drivers/char/Makefile
:
obj-y += mem.o random.o
obj-$(CONFIG_TTY_PRINTK) += ttyprintk.o
The obj-y
rule unconditionally compiles a file to produce the target, so mem.c
and random.c
are always part of the kernel. In the second line, ttyprintk.c
is dependent on a configuration parameter. If CONFIG_TTY_PRINTK
is y
, then it is compiled as a built-in. If it is m
, then it is built as a module. If the parameter is undefined, then it is not compiled at all.
For most targets, just typing...