-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (30 loc) · 1002 Bytes
/
Makefile
File metadata and controls
43 lines (30 loc) · 1002 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
31
32
33
34
35
36
37
38
39
40
41
42
43
BINARY_NAME=mantis
VERSION=$(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
COMMIT=$(shell git rev-parse --short HEAD 2>/dev/null || echo "none")
DATE=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
LDFLAGS=-ldflags "-s -w -X github.com/garagon/mantis/cmd/mantis/cli.version=$(VERSION) -X github.com/garagon/mantis/cmd/mantis/cli.commit=$(COMMIT) -X github.com/garagon/mantis/cmd/mantis/cli.date=$(DATE)"
.PHONY: all build run test lint clean dev generate
all: generate build
build:
go build $(LDFLAGS) -o bin/$(BINARY_NAME) ./cmd/mantis
run: build
./bin/$(BINARY_NAME) serve
dev:
air
generate:
templ generate
test:
go test -race -coverprofile=coverage.out ./...
go tool cover -func=coverage.out
test-html: test
go tool cover -html=coverage.out -o coverage.html
lint:
golangci-lint run ./...
clean:
rm -rf bin/ tmp/ coverage.out coverage.html *.db
install: build
cp bin/$(BINARY_NAME) $(GOPATH)/bin/$(BINARY_NAME)
deps:
go mod tidy
go mod verify
check: lint test