-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathMakefile
More file actions
25 lines (20 loc) · 711 Bytes
/
Makefile
File metadata and controls
25 lines (20 loc) · 711 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
# Variáveis de versão
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
COMMIT_HASH ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown")
BUILD_DATE ?= $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
# Flags para injetar informações de versão
LD_FLAGS = -X github.com/diillson/chatcli/version.Version=$(VERSION) \
-X github.com/diillson/chatcli/version.CommitHash=$(COMMIT_HASH) \
-X github.com/diillson/chatcli/version.BuildDate=$(BUILD_DATE)
.PHONY: build
build:
go build -ldflags "$(LD_FLAGS)" -o bin/chatcli main.go
.PHONY: install
install:
go install -ldflags "$(LD_FLAGS)"
.PHONY: lint
lint:
golangci-lint run
.PHONY: test
test:
go test ./...