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)后就中止執行了。