-
-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathMakefile
More file actions
21 lines (15 loc) · 530 Bytes
/
Makefile
File metadata and controls
21 lines (15 loc) · 530 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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)
VERSION_PATH:=github.com/MichaelMure/mdr
LDFLAGS:=-X main.GitCommit=${GIT_COMMIT} \
-X main.GitLastTag=${GIT_LAST_TAG} \
-X main.GitExactTag=${GIT_EXACT_TAG}
build:
go build -ldflags "$(LDFLAGS)" .
install:
go install -ldflags "$(LDFLAGS)" .
releases:
gox -ldflags "$(LDFLAGS)" -output "dist/{{.Dir}}_{{.OS}}_{{.Arch}}"
.PHONY: build install releases