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=