Make, how use it in kernel’s compiling.

When you need to compile the linux kernel, you certally must use make command. In this post I will describe some ways how use it to compile linux.

First you need have a version of linux, you can find it in http://www.kernel.org. So choice a version and download.

make clean: To remove all objects generated in previous compiling.

make mproper: Besides to remove all objects (make clean), remove the .config file too.

make dep: Solves dependences, it should be used after you have configured your kenrel.

make defconfig: Generates a default .config

make allyesconfig: Set all fields in .config as [y]

make allnoconfig: Doesn’t set any field in .config

make allmodconfig: Sets all options like as [m] (module) in .config file.

make randconfig: Generates a new kernel configuration with randow answers to all differents options.

make menuconfig: Opens a graphic interface to user to configure the .config file. Here you need install ncurses libraries.

make bzImage: Generates a linux image which you can make boot with any bootloader.

make modules: Compiles linux modules that you have configured in .config file.

make module_install: Uses this command to install the kernel modules into the directory path:

/lib/modules/<KERNELVERSION>/kernel/drivers(Makefile)

You can to define a new directory root which to install the modules following the command below:

make module_install INSTALL_MOD_PATH=<chosen directory>

These commands described above must be executed into linux kernel directory. Because the make command need a target file (Makefile).

Não ha comentários

Leave a reply