-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (21 loc) · 728 Bytes
/
Makefile
File metadata and controls
29 lines (21 loc) · 728 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
.PHONY: build test lint fmt ci install clean
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 := -ldflags "-s -w -X github.com/dedene/irail-cli/internal/cmd.version=$(VERSION) -X github.com/dedene/irail-cli/internal/cmd.commit=$(COMMIT) -X github.com/dedene/irail-cli/internal/cmd.date=$(DATE)"
build:
@mkdir -p bin
go build $(LDFLAGS) -o bin/irail ./cmd/irail
test:
go test -race -v ./...
lint:
golangci-lint run
fmt:
go fmt ./...
goimports -w .
ci: fmt lint test build
install:
go install $(LDFLAGS) ./cmd/irail
clean:
rm -rf bin/
rm -rf dist/