forked from goflyfox/gmanager
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
45 lines (37 loc) · 823 Bytes
/
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
38
39
40
41
42
43
44
45
# note: call scripts from /deploy
# project name
PROJECTNAME=$(shell basename "$(PWD)")
# project path
ROOT=$(shell pwd)
.PHONY: help
all: help
help: Makefile
@echo
@echo " Choose a command run in "$(PROJECTNAME)":"
@echo
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
@echo
## vendor: go mod vendor
## tidy: go mod tidy
## build: go build -mod=vendor
## run: go run main.go
## mod: update or clear mod pkg, do=tidy or do=vendor
mod:
@echo "use mod"
@./deploy/pkg.sh $(ROOT) $(do)
vendor:
@echo "use mod vendor"
@export GO111MODULE=on
@export GOPROXY=https://goproxy.io
@go mod vendor
tidy:
@echo "use mod tidy"
@export GO111MODULE=on
@export GOPROXY=https://goproxy.io
@go mod tidy
#go build -ldflags "-s -w"
build:
@go build -mod=vendor
run:
@echo "go run main.go"
@go run main.go