Makefile 執行指令遇到錯誤時,繼續執行


舉例說明,假設執行下面指令:

sudo apt-get install opencc
go get -u github.com/siongui/go-opencc

若第一行執行時發生錯誤(比方說安裝失敗),第二行將不會執行。

[2] 的回答,若在第一行前面加 - ,則第一行執行失敗時 ,仍然會繼續往下執行,不會停止:

-sudo apt-get install opencc
go get -u github.com/siongui/go-opencc

References:

[1]

makefile do not stop on error - Google search

makefile do not stop on error - DuckDuckGo search

makefile do not stop on error - Bing search

makefile do not stop on error - Yahoo search

makefile do not stop on error - Baidu search

makefile do not stop on error - Yandex search

[2]makefile - Make: how to continue after a command fails? - Stack Overflow