11 lines
401 B
Makefile
11 lines
401 B
Makefile
|
GOPATH:=$(shell go env GOPATH)
|
||
|
DATETIME:=$(shell date "+%Y-%m-%d %H:%M:%S")
|
||
|
PKGNAME:="git.nobla.cn/golang/moto"
|
||
|
GIT_VERSION=$(shell git rev-parse --short HEAD)
|
||
|
|
||
|
.PHONY: build
|
||
|
|
||
|
build:
|
||
|
go mod tidy
|
||
|
go mod vendor
|
||
|
CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags "-s -w -X '$(PKGNAME)/version.Version=$(GIT_VERSION)' -X '$(PKGNAME)/version.BuildDate=$(DATETIME)'" -o ./bin/$(APP_NAME) ./cmd/main.go
|