-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (22 loc) · 742 Bytes
/
Makefile
File metadata and controls
30 lines (22 loc) · 742 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
.PHONY: build test lint clean run install
BINARY=crontui
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo "none")
LDFLAGS = -s -w -X github.com/meru143/crontui/internal/version.Version=$(VERSION) \
-X github.com/meru143/crontui/internal/version.Commit=$(COMMIT)
build:
go build -ldflags "$(LDFLAGS)" -o $(BINARY) .
run: build
./$(BINARY)
install:
go install -ldflags "$(LDFLAGS)" .
test:
go test ./... -v -race -cover
lint:
golangci-lint run ./...
clean:
rm -f $(BINARY)
rm -f coverage.out coverage.html
coverage:
go test ./... -coverprofile=coverage.out
go tool cover -html=coverage.out -o coverage.html