Makefile調用Shell語句引起的一個錯誤

爲了解決遞歸複製目錄的時候,不復制.svn目錄,將原來的cp命令修改成rsync命令,卻引發Makefile始終編譯不過。 shell

測試的Makefile svn

Top:
        echo "Makefile include shell script"

$(shell rsync -av --exclude=".*" abc def)
錯誤:
Makefile:4: *** missing separator.  Stop.

緣由
$(shell rsync -av --exclude=".*" abc def)的結果是一堆result字符

因此makefile文件就解析爲下: 
Top:
        echo "Makefile include shell script"

$(result)
能夠用這種方法來解決 $(warning $(shell rsync -av --exclude=".*" abc def))
相關文章
相關標籤/搜索