Compiling the kernel involves a number of steps: building the kernel dependencies, building the kernel image, and building the kernel modules. Each step uses a separate make command and is described separately in this section. However, you could also carry out all these steps using a single command line.
Most files in the kernel's sources depend on a number of header files. To build the kernel adequately, the kernel's Makefiles need to know about these dependencies. For each subdirectory in the kernel tree, a hidden .depend file is created during the dependencies build. This contains the list of header files that each file in the directory depends on. As with other software that relies on make, only the files that depend on a header that changed since the last build will need to be recompiled when a kernel is rebuilt.
From the kernel source's root directory, the following command builds the kernel's dependencies:
make ARCH=arm CROSS_COMPILE=arm-linux- clean dep
in the configuration of the kernel earlier, we set the
variables. As I explained in Chapter 4,
CROSS_COMPILE is only required when source code is
actually compiled, and could be omitted here. On the other hand, we
will need to set at least the
ARCH variable for
every make command we issue because we are
cross-compiling the kernel. Even when issuing make
clean or make distclean, we will need to set this variable. Otherwise, the kernel's Makefiles assume ...