Makefile: Phony Targets
Makefile Rule Makefile Rule 格式如下 1 2 target: prerequisites recipe target: 要產生的檔案名稱 prerequisites: 產生 target 所需要的檔案 recipe: 要執行的動作 這裡準備一個寫 golang 會用到的 Makefile 如下面: 1 2 build: go build -o main main.go 執行 make build,Make 會先檢查有沒有 build 這個檔案,當檔案不存在的時候就執行 go build ... 指令 ...