增加Makefile的模式
This commit is contained in:
28
agent-go/Makefile
Normal file
28
agent-go/Makefile
Normal file
@@ -0,0 +1,28 @@
|
||||
SHELL := /bin/bash
|
||||
BASEDIR = $(shell pwd)
|
||||
|
||||
.PHONY: help
|
||||
help:
|
||||
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
||||
|
||||
.PHONY: install
|
||||
install: ## Install dependencies
|
||||
@go mod download
|
||||
@go mod vendor
|
||||
|
||||
.PHONY: dev
|
||||
dev: ## Run with Dev
|
||||
@test -f conf/config.local.yml || cp conf/config.local.yml.example conf/config.local.yml
|
||||
@go run main.go
|
||||
|
||||
.PHONY: build
|
||||
build: ## Build todomvc
|
||||
@go build -o build/agent-go main.go
|
||||
|
||||
.PHONY: dev
|
||||
run: ## Run with Dev
|
||||
@go build -o build/agent-go main.go
|
||||
@go run build/agent-go
|
||||
|
||||
clean: ### Remove build dir
|
||||
@rm -fr build
|
||||
Reference in New Issue
Block a user