2
期間在Makefile中出錯我需要檢查文件是否存在。關於這個answer from holms,我嘗試了這種方式:在Makefile中檢查現有文件
all:
ifeq ("","$(wildcard testFile)")
echo "File exists"
else
echo "File is missing"
endif
不過,我得到這個錯誤:
ifeq ("","")
/bin/sh: 1: Syntax error: word unexpected (expecting ")")
Makefile:3: recipe for target 'all' failed
make: *** [all] Error 2
哪裏是我的錯誤,如何解釋這個語法錯誤消息?
好的,謝謝你的幫助。我明白,'ifeq'語句由'make'解釋。但是使用'echo'的行應該有一個製表符,因爲它們需要傳遞給我的shell,對吧? – eDeviser
@eDeviser這是正確的。 – user657267
好吧,你的答案似乎顯示四個空格而不是一個製表符,這可能只是stackExchanges編輯器的一個風格問題。 – eDeviser