forked from bjarneo/cliamp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (20 loc) · 662 Bytes
/
Copy pathMakefile
File metadata and controls
29 lines (20 loc) · 662 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
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
BINARY ?= cliamp
LDFLAGS := -s -w -X main.version=$(VERSION)
.PHONY: build test vet lint fmt check clean install
build:
go build -trimpath -ldflags="$(LDFLAGS)" -o $(BINARY) .
test:
go test ./...
vet:
go vet ./...
lint: vet
@if command -v staticcheck >/dev/null 2>&1; then staticcheck ./...; else echo "staticcheck not installed — skipping (go install honnef.co/go/tools/cmd/staticcheck@latest)"; fi
fmt:
gofmt -l -w .
check: fmt vet test
clean:
rm -f $(BINARY)
install: build
install -d $(HOME)/.local/bin
install -m 755 $(BINARY) $(HOME)/.local/bin/$(BINARY)