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

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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM