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