0
我正在拾取一些超出我的規範的舊代碼,並且遇到了一些希望解釋非常簡單的問題。ifeq makefile中的意外令牌
我正在研究一個運行大量sql文件的makefile,然後生成.done文件來跟蹤進度。在一個特定的sql文件後,我需要能夠運行一個shell腳本來做一些額外的處理。
# this is the rule the describes how to execute a SQL script
%.done: %.sql
@echo "+==============================================================================+"
@echo "building [email protected]"
@echo "...from $<"
@echo "building $<"
@$(PSQL_WRAPPER) -f $<
@ifeq ($(@),mysqlfile.done)
@echo "Executing Shell Script"
@../path/to/script/myscript.sh
endif
我添加了ifeq部分,其他所有東西都在那裏,並按預期工作。
這是我得到的輸出。我真的被卡住了,一直在嘗試不同的小小的語法調整,但顯然還有一些我只是不理解的東西。
+==============================================================================+
building mysqlfile.done
...from ../..//path/to/file/mysqlfile.sql
building ../..//path/to/file/mysqlfile.sql
/bin/bash: -c: line 0: syntax error near unexpected token `mysqlfile.done,mysqlfile.done'
/bin/bash: -c: line 0: `ifeq (mysqlfile.done,mysqlfile.done)'
make: *** [mysqlfile.done] Error 1
Command exited with non-zero status 2
從錯誤消息,它看起來像我有兩個相等的值。我真的不確定那個意外的令牌會是什麼。我非常感謝能夠得到的任何幫助。
謝謝,這是做到了。 –