-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
37 lines (25 loc) · 1.04 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
RELNAME=mono_personal_tgbot
GOARCH=amd64
# Setup the -ldflags option for go build here, interpolate the variable values
LDFLAGS = -ldflags "-s -w"
dev: ## run on local machine
$(shell cat .env | sed -e /^#/d | xargs) go run .
test: ## test
go test ./...
release: linux darwin windows ## Build a release
linux:
CGO_ENABLED=0 GOOS=linux GOARCH=${GOARCH} go build ${LDFLAGS} -o ./release/${RELNAME}-linux-${GOARCH} *.go
darwin:
CGO_ENABLED=0 GOOS=darwin GOARCH=${GOARCH} go build ${LDFLAGS} -o ./release/${RELNAME}-darwin-${GOARCH} *.go
windows:
CGO_ENABLED=0 GOOS=windows GOARCH=${GOARCH} go build ${LDFLAGS} -o ./release/${RELNAME}-windows-${GOARCH}.exe *.go
up: ## To up all containers
docker-compose up --build -d
down: ## To down all containers
docker-compose stop
fmt: ## fmt
go fmt ./...
# Absolutely awesome: http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.DEFAULT_GOAL := help