今天寫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
