-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
55 lines (41 loc) · 998 Bytes
/
Makefile
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
49
50
51
52
53
54
55
APP := peribolos-syncer
bins := git go gofumpt golangci-lint ginkgo
define declare_binpaths
$(1) = $(shell command -v 2>/dev/null $(1))
endef
$(foreach bin,$(bins),\
$(eval $(call declare_binpaths,$(bin)))\
)
.PHONY: ginkgo
ginkgo:
@hash ginkgo || \
$(go) install github.com/onsi/ginkgo/v2/ginkgo
.PHONY: docs
docs:
@go run docs/docs.go
.PHONY: build
build:
@$(go) build .
.PHONY: run
run:
@$(go) run .
.PHONY: test
test: ginkgo
@$(ginkgo) ./...
.PHONY: lint
lint: golangci-lint
@$(golangci-lint) run ./...
.PHONY: golangci-lint
golangci-lint:
@$(go) install github.com/golangci/golangci-lint/cmd/[email protected]
.PHONY: gofumpt
gofumpt:
@$(go) install mvdan.cc/[email protected]
.PHONY: clean
clean:
@rm -f $(APP)
.PHONY: help
help: list
.PHONY: list
list:
@LC_ALL=C $(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'