File: Makefile

package info (click to toggle)
go-md2man-v2 2.0.0+ds-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, experimental, sid
  • size: 144 kB
  • sloc: makefile: 40; sh: 9
file content (48 lines) | stat: -rw-r--r-- 954 bytes parent folder | download | duplicates (4)
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
44
45
46
47
48
GO111MODULE ?= on
LINTER_BIN ?= golangci-lint

export GO111MODULE

.PHONY:
build: bin/go-md2man

.PHONY: clean
clean:
	@rm -rf bin/*

.PHONY: check
check: lint

.PHONY: test
test:
	@go test $(TEST_FLAGS) ./...

.PHONY: lint
lint:
	@$(LINTER_BIN) run --new-from-rev "HEAD~$(git rev-list master.. --count)" ./...

bin/go-md2man: actual_build_flags := $(BUILD_FLAGS) -o bin/go-md2man
bin/go-md2man: bin
	@CGO_ENABLED=0 go build $(actual_build_flags)

bin:
	@mkdir ./bin

$(LINTER_BIN): linter_bin_path := $(shell which $(LINTER_BIN))
$(LINTER_BIN):
	@if [ -z $(linter_bin_path) ] || [ ! -x $(linter_bin_path) ]; then \
		curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.15.0; \
	fi

.PHONY: mod
mod:
	@go mod tidy

.PHONY: check-mod
check-mod: # verifies that module changes for go.mod and go.sum are checked in
	@hack/ci/check_mods.sh

.PHONY: vendor
vendor: mod
	@go mod vendor -v