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