Makefile中的幾個除錯方法

2021-08-20 08:36:06 字數 578 閱讀 4633

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

方法1: $(info, "here add the debug info")

但是此不能列印出.mk的行號

方法2: $(warning, "here add the debug info")

方法3: $(error "error: this will stop the compile")

這個可以停止當前makefile的編譯

方法4: 列印變數的值

2,使用echo增加除錯資訊(echo只能在target:後面的語句中使用,且前面是個tab)

方法1: @echo "start the compile*********************xx"

方法2: @echo $(files)

Linux中C程式除錯 makefile

gcc基本語法格式 gcc 選項 原始檔 選項 目標檔案,gcc編譯c程式的過程 預處理 gcc e hello.c hello.i。e指定執行到預處理結束,下面類似。編譯 gcc s hello.i o hello.s。彙編 gcc c hello.s o hello.o。函式庫有靜態庫和動態庫兩...

JS中all Collection 的幾個方法

1.length屬性 返回集合中元素的個數。2.item vindex isubindex 方法 一 如果只有乙個引數 引數為整型 1 如果引數是整數,根據索引返回子元素 2 如果引數是字串,根據name或者id返回乙個集合或者子元素 二 如果有兩個引數 第乙個引數為字串,第二個引數為整型 1 第乙...

介紹幾個常用的makefile函式

addprefix.addprefix 功能 把加到name序列中的每乙個元素前面。result addprefix c cpp test echo result 輸出 c cpp addsuffix 用法與addprefix相同,只是乙個是字首,乙個是字尾。if.if 功能 引數是 if的表示式,...