makefile之调试信息

时间:2023-03-09 03:28:46
makefile之调试信息

makefile 调试

1. 添加调试信息

执行到error时会中断,warning不中断makefile的执行, info不打印当前makefile名和行号。

a.$(warning "some text") --- warning 不中断makefile的执行,打印warning中的信息,并打印当前makefile文件名和行号。

b.$(info "some text") --- info 打印 "some text"。

c.$(error TEXT…) ---包含warning的功能,同时会中断makefile的执行并退出。


$(warning "this is warning log")
$(info "this is info log")
$(error "this is error log")
all:
gcc debug.c -o debug

源码路径:https://github.com/suonikeyinsuxiao/trunk/tree/master/makefile_project/debug/debug1

makefile之调试信息

从执行结果可以看出,make并没有生成 debug,而是在遇到$(error)后就中止执行了。