moto/Makefile

11 lines
401 B
Makefile
Raw Permalink Normal View History

2024-12-13 16:09:02 +08:00
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