diff options
author | Michael Muré <michael.mure@consensys.net> | 2019-02-20 21:56:33 +0100 |
---|---|---|
committer | Michael Muré <michael.mure@consensys.net> | 2019-02-20 21:56:33 +0100 |
commit | 59ea2e018e05e7a4033d572f819f4a696ab74397 (patch) | |
tree | 01a427bfc2f67208e1801e8e06a934d91eb9a777 /Makefile | |
parent | 09692456c7a5491b37a22d72e652de66ecc8d4e7 (diff) | |
download | git-bug-59ea2e018e05e7a4033d572f819f4a696ab74397.tar.gz |
add a "version" command with various outputs, including the git hash and tag
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -1,13 +1,21 @@ all: build +GIT_COMMIT:=$(shell git rev-list -1 HEAD) +GIT_LAST_TAG:=$(shell git describe --abbrev=0 --tags) +GIT_EXACT_TAG:=$(shell git name-rev --name-only --tags HEAD) +COMMANDS_PATH:=github.com/MichaelMure/git-bug/commands +LDFLAGS:=-X ${COMMANDS_PATH}.GitCommit=${GIT_COMMIT} \ + -X ${COMMANDS_PATH}.GitLastTag=${GIT_LAST_TAG} \ + -X ${COMMANDS_PATH}.GitExactTag=${GIT_EXACT_TAG} + build: go generate - go build . + go build -ldflags "$(LDFLAGS)" . # produce a build debugger friendly debug-build: go generate - go build -gcflags=all="-N -l" . + go build -ldflags "$(LDFLAGS)" -gcflags=all="-N -l" . install: go generate |