make/Makefile verbose

本文深入探讨了使用make命令的不同选项来实现详细的构建过程输出及调试信息的方法。文章讲解了如何利用make的-v、-n选项及--debug参数来增强构建过程的可见性和调试能力,并通过实例展示了这些选项的具体应用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. Linux for example kernel 

make V=1

For CMake, use make VERBOSE=1; for GNU autotools make V=1

This depends on your make program.

Note:  make -s  (silent) will suppress all make log.

 

2. make -n 

Show logic commands excuted by make

 

3. Linux app/Makefile /GNU make 3.80

Note this is used for verbose print of Makefile parsing 

‘--debug[=options]’

Print debugging information in addition to normal processing. Various levels and types of output can be chosen. With no arguments, print the “basic” level of debugging. Possible arguments are below; only the first character is considered, and values must be comma- or space-separated.

a (all)

All types of debugging output are enabled. This is equivalent to using ‘-d’.

b (basic)

Basic debugging prints each target that was found to be out-of-date, and whether the build was successful or not.

v (verbose)

A level above ‘basic’; includes messages about which makefiles were parsed, prerequisites that did not need to be rebuilt, etc. This option also enables ‘basic’ messages.

“—debug[=]”
输出make的调试信息。它有几种不同的级别可供选择,如果没有参数,那就是输出最简单的调试信息。下面是的取值:
a —— 也就是all,输出所有的调试信息。(会非常的多)
b —— 也就是basic,只输出简单的调试信息。即输出不需要重编译的目标。
v —— 也就是verbose,在b选项的级别之上。输出的信息包括哪个makefile被解析,不需要被重编译的依赖文件(或是依赖目标)等。
i —— 也就是implicit,输出所以的隐含规则。
j —— 也就是jobs,输出执行规则中命令的详细信息,如命令的PID、返回码等。
m —— 也就是makefile,输出make读取makefile,更新makefile,执行makefile的信息。

“-d”
相当于“–debug=a”。

 

 

 

3. Android/Makefile   $(hide)   $@

hide := @

 

#========================================
# if HIDE is not defined then define it.
# to use this:
#     bash$  make  HIDE= -f Makefile
# or  bash$  make  HIDE= -f foo_test.mak
#
HIDE ?= @

 

# Compile
#  NOTE: "-MMD" and "-MF" create compiler dependancy files
#        Which we load below with an include statement.
${OBJDIR}/%.o: %.c
    ${HIDE}mkdir -p ${OBJDIR}
    ${HIDE}echo "Compling: $<"
    ${HIDE}${GCC_EXE} -g -c ${CFLAGS} ${ARCH_CFLAGS} -MP -MMD -MF ${OBJDIR}/${*F}.d -o ${OBJDIR}/${@F} $<

 

 

 

$ echo  "show make detail" 

$make test.c   HIDE=     

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值