增加Makefile的模式

This commit is contained in:
zeaslity
2024-10-30 16:34:55 +08:00
parent d8f01f9b99
commit 82bdcca604

28
agent-go/Makefile Normal file
View 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