-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (22 loc) · 804 Bytes
/
Copy pathMakefile
File metadata and controls
29 lines (22 loc) · 804 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
GO ?= go
VERSION ?= dev
COMMIT ?= $(shell git rev-parse --short=12 HEAD 2>/dev/null || echo unknown)
BUILD_DATE ?= $(shell git show -s --format=%cI HEAD 2>/dev/null || echo unknown)
LDFLAGS = -s -w -buildid= \
-X github.com/Aethersailor/Rule-Bot-Client/internal/client.BuildVersion=$(VERSION) \
-X github.com/Aethersailor/Rule-Bot-Client/internal/client.BuildCommit=$(COMMIT) \
-X github.com/Aethersailor/Rule-Bot-Client/internal/client.BuildDate=$(BUILD_DATE)
.PHONY: build test race vet fmt-check clean
build:
mkdir -p bin
CGO_ENABLED=0 $(GO) build -buildvcs=false -trimpath -ldflags="$(LDFLAGS)" -o bin/rule-bot-client ./cmd/rule-bot-client
test:
$(GO) test ./...
race:
$(GO) test -race ./...
vet:
$(GO) vet ./...
fmt-check:
test -z "$$(gofmt -l cmd internal)"
clean:
rm -rf bin dist