makefile中的縮進


今天寫makefile中遇到了2個問題。
Makefile missing separator. Stop*** recipe commences before first target. Stop.

問題一: Makefile missing separator. Stop

當出現這種error,一般與Tab縮進有關,makefile要求命令行開頭必須用tab鍵

clean:
    rm *.cpp~    //必須縮進

問題二: recipe commences before first target. Stop

出現這種error是因為命令缺了一個target。

# 錯誤例子
ifndef src
    @echo "src no define"
endif

# 糾正
ifndef src
warning:
    @echo "src no define"
endif


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM