在编译kernel 或者 kernel module的时候,默认的输出到stdout的形式是一段简短的提示
如:
CC [M] xxx.o
LD [M] xxx.o
等
但这样看不到具体由哪些东西编译在一起的。
其实这个可以再 scripts/Kbuild.include 文件中修改,能让输出显示更多的信息。 虽然格式丑了点
在Kbuild.include中的 167行
# Execute command if command has changed or prerequisite(s) are updated.
#
if_changed
= $(if $(strip $(any-prereq) $(arg-check)), /
@set -e
; /
$(echo-cmd) $(cmd_$(1)); /
echo 'cmd_$@ := $(make-cmd)' > $(dot-target).cmd)
# Execute the command and also postprocess generated .d dependencies file.
if_changed_dep
= $(if $(strip $(any-prereq) $(arg-check) ), /
@set -e
; /
$(echo-cmd) $(cmd_$(1)); /
scripts/basic/fixdep $(depfile) $@ '$(make-cmd)' > $(dot-target).tmp;/
rm -f $(depfile); /
mv -f $(dot-target).tmp $(dot-target).cmd)
# Usage: $(call if_changed_rule,foo)
# Will check if $(cmd_foo) or any of the prerequisites changed,
# and if so will execute $(rule_foo).
if_changed_rule
= $(if $(strip $(any-prereq) $(arg-check) ), /
@set -e;
/
$(rule_$(1)))
这三条是比较重要的宏定义。 主要是因为 @set -e;的作用使得 后续的命令都隐藏了。
只要把这个 @ 去掉,详细信息就可以显示出来了。