-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (33 loc) · 987 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
include ./Makefile.Common
ALL_MODULES := $(shell find . -type f -name "go.mod" -exec dirname {} \; | sort | grep -E '^./' )
all-modules:
@echo $(ALL_MODULES) | tr ' ' '\n' | sort
# Append root module to all modules
GOMODULES = $(ALL_MODULES)
# Define a delegation target for each module
.PHONY: $(GOMODULES)
$(GOMODULES):
@echo "Running target '$(TARGET)' in module '$@'"
$(MAKE) -C $@ $(TARGET)
.PHONY: for-all-target
for-all-target: $(GOMODULES)
.PHONY: gotest
gotest:
@$(MAKE) for-all-target TARGET="test"
.PHONY: gotest-with-cover
gotest-with-cover:
@$(MAKE) for-all-target TARGET="test-with-cover"
$(GOCMD) tool covdata textfmt -i=./coverage/unit -o ./coverage.txt
.PHONY: golint
golint:
@$(MAKE) for-all-target TARGET="lint"
.PHONY: gotidy
gotidy:
@$(MAKE) for-all-target TARGET="tidy"
.PHONY: multimod-verify
multimod-verify:
$(MULTIMOD) verify
.PHONY: multimod-prerelease
multimod-prerelease:
$(MULTIMOD) prerelease --module-set-names stable
$(MAKE) gotidy