diff --git a/Makefile b/Makefile index df3bc41..4aea8f3 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ .PHONY: dev build generate install image release profile bench test clean CGO_ENABLED=0 +VERSION=$(shell git describe --abbrev=0 --tags) COMMIT=$(shell git rev-parse --short HEAD) all: dev @@ -12,11 +13,11 @@ dev: build build: clean generate @go build \ -tags "netgo static_build" -installsuffix netgo \ - -ldflags "-w -X $(shell go list)/.Commit=$(COMMIT)" \ + -ldflags "-w -X $(shell go list).Version=$(VERSION) -X $(shell go list).Commit=$(COMMIT)" \ ./cmd/bitcask/... @go build \ -tags "netgo static_build" -installsuffix netgo \ - -ldflags "-w -X $(shell go list)/.Commit=$(COMMIT)" \ + -ldflags "-w -X $(shell go list).Version=$(VERSION) -X $(shell go list).Commit=$(COMMIT)" \ ./cmd/bitcaskd/... generate: