-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
23 lines (18 loc) · 872 Bytes
/
Makefile
File metadata and controls
23 lines (18 loc) · 872 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
.PHONY: test test-cover clean build-plugin
BINARY := statusline
PLUGIN_DIR := plugins/statusline/bin
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
LDFLAGS := -ldflags "-s -w -X main.version=$(VERSION)"
build-plugin:
mkdir -p $(PLUGIN_DIR)
GOOS=darwin GOARCH=amd64 go build $(LDFLAGS) -o $(PLUGIN_DIR)/$(BINARY)-darwin-amd64 ./cmd/statusline
GOOS=darwin GOARCH=arm64 go build $(LDFLAGS) -o $(PLUGIN_DIR)/$(BINARY)-darwin-arm64 ./cmd/statusline
GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o $(PLUGIN_DIR)/$(BINARY)-linux-amd64 ./cmd/statusline
GOOS=linux GOARCH=arm64 go build $(LDFLAGS) -o $(PLUGIN_DIR)/$(BINARY)-linux-arm64 ./cmd/statusline
test:
go test ./...
test-cover:
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
clean:
rm -rf $(PLUGIN_DIR) coverage.out coverage.html