1. 程式人生 > 其它 >Makefile:Makefile中的除錯列印方法

Makefile:Makefile中的除錯列印方法

技術標籤:MAKEFILE檔案

Makefile中的除錯列印方法

使用info/warning/error增加除錯資訊

info

#info資訊,不列印資訊所在行號
$(info “here add the debug info”)
  • 1
  • 2

warning

#這個可以停止當前makefile的編譯
$(error “error: this will stop the compile”)
  • 1
  • 2

列印變數的值

$(info $(TARGET_DEVICE) )
  • 1

使用echo增加除錯資訊

注:echo只能在target:後面的語句中使用,且前面是個TAB

@echo “start the compilexxxxxxxxxxxxxxxxxxxxxxx”
@echo $(files)
  • 1
  • 2

[外鏈圖片轉存失敗,源站可能有防盜鏈機制,建議將圖片儲存下來直接上傳(img-FLjt7v8I-1604215393790)(./images/20190320162125140.png)]