forked from rlrghb/olkcli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (24 loc) · 761 Bytes
/
Copy pathMakefile
File metadata and controls
33 lines (24 loc) · 761 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo "none")
DATE ?= $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
MODULE = github.com/rlrghb/olkcli
LDFLAGS = -s -w \
-X $(MODULE)/internal/cmd.Version=$(VERSION) \
-X $(MODULE)/internal/cmd.Commit=$(COMMIT) \
-X $(MODULE)/internal/cmd.Date=$(DATE)
BINARY = ./bin/olk
.PHONY: build test lint install clean version
build:
go build -ldflags '$(LDFLAGS)' -o $(BINARY) ./cmd/olk
test:
go test -race -count=1 ./...
lint:
golangci-lint run ./...
install: build
cp $(BINARY) $(GOPATH)/bin/olk
clean:
rm -rf ./bin
version:
@echo "Version: $(VERSION)"
@echo "Commit: $(COMMIT)"
@echo "Date: $(DATE)"