|
1 | 1 | ################################################################################ |
2 | 2 |
|
3 | | -# This Makefile generated by GoMakeGen 1.5.1 using next command: |
| 3 | +# This Makefile generated by GoMakeGen 2.1.0 using next command: |
4 | 4 | # gomakegen --mod . |
5 | 5 | # |
6 | 6 | # More info: https://kaos.sh/gomakegen |
|
9 | 9 |
|
10 | 10 | export GO111MODULE=on |
11 | 11 |
|
| 12 | +ifdef VERBOSE ## Print verbose information (Flag) |
| 13 | +VERBOSE_FLAG = -v |
| 14 | +endif |
| 15 | + |
| 16 | +MAKEDIR = $(dir $(realpath $(firstword $(MAKEFILE_LIST)))) |
| 17 | +GITREV ?= $(shell test -s $(MAKEDIR)/.git && git rev-parse --short HEAD) |
| 18 | + |
| 19 | +################################################################################ |
| 20 | + |
12 | 21 | .DEFAULT_GOAL := help |
13 | | -.PHONY = fmt vet deps deps-test test mod-init mod-update mod-vendor help |
| 22 | +.PHONY = fmt vet deps update test init vendor mod-init mod-update mod-download mod-vendor help |
14 | 23 |
|
15 | 24 | ################################################################################ |
16 | 25 |
|
17 | | -deps: mod-update ## Download dependencies |
| 26 | +init: mod-init ## Initialize new module |
| 27 | + |
| 28 | +deps: mod-download ## Download dependencies |
18 | 29 |
|
19 | | -deps-test: deps ## Download dependencies for tests |
| 30 | +update: mod-update ## Update dependencies to the latest versions |
| 31 | + |
| 32 | +vendor: mod-vendor ## Make vendored copy of dependencies |
20 | 33 |
|
21 | 34 | test: ## Run tests |
22 | | - go test -covermode=count . |
| 35 | +ifdef COVERAGE_FILE ## Save coverage data into file (String) |
| 36 | + go test $(VERBOSE_FLAG) -covermode=count -coverprofile=$(COVERAGE_FILE) . |
| 37 | +else |
| 38 | + go test $(VERBOSE_FLAG) -covermode=count . |
| 39 | +endif |
23 | 40 |
|
24 | | -mod-init: ## Initialize new module |
| 41 | +mod-init: |
| 42 | +ifdef MODULE_PATH ## Module path for initialization (String) |
| 43 | + go mod init $(MODULE_PATH) |
| 44 | +else |
25 | 45 | go mod init |
26 | | - go mod tidy |
| 46 | +endif |
| 47 | + |
| 48 | +ifdef COMPAT ## Compatible Go version (String) |
| 49 | + go mod tidy $(VERBOSE_FLAG) -compat=$(COMPAT) |
| 50 | +else |
| 51 | + go mod tidy $(VERBOSE_FLAG) |
| 52 | +endif |
| 53 | + |
| 54 | +mod-update: |
| 55 | +ifdef UPDATE_ALL ## Update all dependencies (Flag) |
| 56 | + go get -u $(VERBOSE_FLAG) all |
| 57 | +else |
| 58 | + go get -u $(VERBOSE_FLAG) ./... |
| 59 | +endif |
| 60 | + |
| 61 | +ifdef COMPAT |
| 62 | + go mod tidy $(VERBOSE_FLAG) -compat=$(COMPAT) |
| 63 | +else |
| 64 | + go mod tidy $(VERBOSE_FLAG) |
| 65 | +endif |
| 66 | + |
| 67 | + test -d vendor && rm -rf vendor && go mod vendor $(VERBOSE_FLAG) || : |
27 | 68 |
|
28 | | -mod-update: ## Download modules to local cache |
| 69 | +mod-download: |
29 | 70 | go mod download |
30 | 71 |
|
31 | | -mod-vendor: ## Make vendored copy of dependencies |
32 | | - go mod vendor |
| 72 | +mod-vendor: |
| 73 | + rm -rf vendor && go mod vendor $(VERBOSE_FLAG) |
33 | 74 |
|
34 | 75 | fmt: ## Format source code with gofmt |
35 | 76 | find . -name "*.go" -exec gofmt -s -w {} \; |
36 | 77 |
|
37 | | -vet: ## Runs go vet over sources |
| 78 | +vet: ## Runs 'go vet' over sources |
38 | 79 | go vet -composites=false -printfuncs=LPrintf,TLPrintf,TPrintf,log.Debug,log.Info,log.Warn,log.Error,log.Critical,log.Print ./... |
39 | 80 |
|
40 | 81 | help: ## Show this info |
41 | | - @echo -e '\n\033[1mSupported targets:\033[0m\n' |
| 82 | + @echo -e '\n\033[1mTargets:\033[0m\n' |
42 | 83 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \ |
43 | | - | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[33m%-12s\033[0m %s\n", $$1, $$2}' |
| 84 | + | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[33m%-14s\033[0m %s\n", $$1, $$2}' |
| 85 | + @echo -e '\n\033[1mVariables:\033[0m\n' |
| 86 | + @grep -E '^ifdef [A-Z_]+ .*?## .*$$' $(abspath $(lastword $(MAKEFILE_LIST))) \ |
| 87 | + | sed 's/ifdef //' \ |
| 88 | + | awk 'BEGIN {FS = " .*?## "}; {printf " \033[32m%-14s\033[0m %s\n", $$1, $$2}' |
44 | 89 | @echo -e '' |
45 | | - @echo -e '\033[90mGenerated by GoMakeGen 1.5.1\033[0m\n' |
| 90 | + @echo -e '\033[90mGenerated by GoMakeGen 2.1.0\033[0m\n' |
46 | 91 |
|
47 | 92 | ################################################################################ |
0 commit comments