Debian Codegraph @

Makefile

raw
1 # Directory containing the Makefile.
2 PROJECT_ROOT = $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
3
4 export GOBIN = $(PROJECT_ROOT)/bin
5 export PATH := $(GOBIN):$(PATH)
6
7 GO_FILES = $(shell find . \
8 -path '*/.*' -prune -o \
9 '(' -type f -a -name '*.go' ')' -print)
10
11 # Additional test flags.
12 TEST_FLAGS ?=
13
14 .PHONY: all
15 all: lint build test
16
17 .PHONY: lint
18 lint: golangci-lint tidy-lint
19
20 .PHONY: build
21 build:
22 go build ./...
23
24 .PHONY: test
25 test:
26 go test -v -race ./...
27 go test -v -trace=/dev/null .
28
29 .PHONY: cover
30 cover:
31 go test -race -coverprofile=cover.out -coverpkg=./... ./...
32 go tool cover -html=cover.out -o cover.html
33
34 .PHONY: golangci-lint
35 golangci-lint:
36 golangci-lint run
37
38 .PHONY: tidy
39 tidy:
40 go mod tidy
41
42 .PHONY: tidy-lint
43 tidy-lint:
44 go mod tidy
45 git diff --exit-code -- go.mod go.sum