-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (23 loc) · 832 Bytes
/
Makefile
File metadata and controls
30 lines (23 loc) · 832 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
30
APP := statusline
VER ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
BUILD ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
LDFLAGS := -s -w -X main.version=$(VER) -X main.build=$(BUILD)
.PHONY: build lint test clean xwin xlinux xmac release
build:
CGO_ENABLED=0 go build -ldflags "$(LDFLAGS)" -o .bin/$(APP) ./cmd/statusline
lint:
golangci-lint run
test:
go test ./...
clean:
rm -rf .bin dist
# cross-compilation
xwin:
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o .bin/$(APP).exe ./cmd/statusline
xlinux:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o .bin/$(APP) ./cmd/statusline
xmac:
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o .bin/$(APP) ./cmd/statusline
# release
release:
goreleaser release --clean