-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
27 lines (21 loc) · 784 Bytes
/
Makefile
File metadata and controls
27 lines (21 loc) · 784 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
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown")
DATE ?= $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
LDFLAGS = -s -w \
-X github.com/paoloanzn/flare-cli/cmd.Version=$(VERSION) \
-X github.com/paoloanzn/flare-cli/cmd.Commit=$(COMMIT) \
-X github.com/paoloanzn/flare-cli/cmd.Date=$(DATE)
.PHONY: build install test lint clean
build:
go build -ldflags '$(LDFLAGS)' -o flare .
install: build
mkdir -p $(HOME)/.local/bin
cp flare $(HOME)/.local/bin/flare
@echo "Installed flare to $(HOME)/.local/bin/flare"
@echo "Make sure $(HOME)/.local/bin is in your PATH"
test:
go test ./... -v
lint:
golangci-lint run ./...
clean:
rm -f flare