makefile --- 调试技巧
make V=1
使用 verbose 编译模式,显示完整编译信息,包括执行的命令
使用info/warning/error增加调试信息
$(info “here add the debug info”)
info信息不打印消息所在的行号
$(warning “here add the debug info”)
warning 打印行号,makefile 继续执行
$(error “error: this will stop the compile”)
error 打印行号,停止执行
打印变量的值
$(info $(TARGET_DEVICE) )
使用echo增加调试信息
注:echo只能放在目标所属的命令,前面有个TAB

输出 makefile 中变量的值
make -s printvars VARS='XXXX'

浙公网安备 33010602011771号