After unpacking the source code for a Linux kernel, what is the first make command that should be run which will delete any current configuration and all generated files? This command will ensure that no inappropriate files were left in the kernel archive by the maintainer.

A.

make depend

B.

make distclean

C.

make config

D.

make clean

E.

make mrproper

题解

Linux 内核的「make clean」会删除大部份编译时产生的文件,但会保留设置档(.config)。「make mrproper」会删除所有产生出来的文件,也会把设置档一并删除。Linux 内核的 README 文档也建议在解开源代码之后,先运行「make mrproper」来确保没有旧的目的档等文件残留。至于「make distclean」则是除了会做「make mrproper」所做的事之外,还会再删除编辑器的备份档和 patch 档。

题目问的是会删除目前的设置和所有产生出来的文件的指令,所以答案是选项 E。