|
1 | 1 | ################################################################################
|
2 | 2 |
|
3 |
| -# This Makefile generated by GoMakeGen 1.5.1 using next command: |
| 3 | +# This Makefile generated by GoMakeGen 2.2.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 all clean deps mod-init mod-update mod-vendor help |
| 22 | +.PHONY = fmt vet all clean deps update init vendor mod-init mod-update mod-download mod-vendor help |
14 | 23 |
|
15 | 24 | ################################################################################
|
16 | 25 |
|
17 | 26 | all: redis-latency-monitor ## Build all binaries
|
18 | 27 |
|
19 |
| -redis-latency-monitor: ## Build redis-latency-monitor binary |
20 |
| - go build redis-latency-monitor.go |
| 28 | +redis-latency-monitor: |
| 29 | + go build $(VERBOSE_FLAG) -ldflags="-X main.gitrev=$(GITREV)" redis-latency-monitor.go |
21 | 30 |
|
22 | 31 | install: ## Install all binaries
|
23 | 32 | cp redis-latency-monitor /usr/bin/redis-latency-monitor
|
24 | 33 |
|
25 | 34 | uninstall: ## Uninstall all binaries
|
26 | 35 | rm -f /usr/bin/redis-latency-monitor
|
27 | 36 |
|
28 |
| -deps: mod-update ## Download dependencies |
| 37 | +init: mod-init ## Initialize new module |
29 | 38 |
|
30 |
| -mod-init: ## Initialize new module |
31 |
| - go mod init |
32 |
| - go mod tidy |
| 39 | +deps: mod-download ## Download dependencies |
| 40 | + |
| 41 | +update: mod-update ## Update dependencies to the latest versions |
33 | 42 |
|
34 |
| -mod-update: ## Download modules to local cache |
| 43 | +vendor: mod-vendor ## Make vendored copy of dependencies |
| 44 | + |
| 45 | +mod-init: |
| 46 | +ifdef MODULE_PATH ## Module path for initialization (String) |
| 47 | + go mod init $(MODULE_PATH) |
| 48 | +else |
| 49 | + go mod init |
| 50 | +endif |
| 51 | + |
| 52 | +ifdef COMPAT ## Compatible Go version (String) |
| 53 | + go mod tidy $(VERBOSE_FLAG) -compat=$(COMPAT) |
| 54 | +else |
| 55 | + go mod tidy $(VERBOSE_FLAG) |
| 56 | +endif |
| 57 | + |
| 58 | +mod-update: |
| 59 | +ifdef UPDATE_ALL ## Update all dependencies (Flag) |
| 60 | + go get -u $(VERBOSE_FLAG) all |
| 61 | +else |
| 62 | + go get -u $(VERBOSE_FLAG) ./... |
| 63 | +endif |
| 64 | + |
| 65 | +ifdef COMPAT |
| 66 | + go mod tidy $(VERBOSE_FLAG) -compat=$(COMPAT) |
| 67 | +else |
| 68 | + go mod tidy $(VERBOSE_FLAG) |
| 69 | +endif |
| 70 | + |
| 71 | + test -d vendor && rm -rf vendor && go mod vendor $(VERBOSE_FLAG) || : |
| 72 | + |
| 73 | +mod-download: |
35 | 74 | go mod download
|
36 | 75 |
|
37 |
| -mod-vendor: ## Make vendored copy of dependencies |
38 |
| - go mod vendor |
| 76 | +mod-vendor: |
| 77 | + rm -rf vendor && go mod vendor $(VERBOSE_FLAG) |
39 | 78 |
|
40 | 79 | fmt: ## Format source code with gofmt
|
41 | 80 | find . -name "*.go" -exec gofmt -s -w {} \;
|
42 | 81 |
|
43 |
| -vet: ## Runs go vet over sources |
| 82 | +vet: ## Runs 'go vet' over sources |
44 | 83 | go vet -composites=false -printfuncs=LPrintf,TLPrintf,TPrintf,log.Debug,log.Info,log.Warn,log.Error,log.Critical,log.Print ./...
|
45 | 84 |
|
46 | 85 | clean: ## Remove generated files
|
47 | 86 | rm -f redis-latency-monitor
|
48 | 87 |
|
49 | 88 | help: ## Show this info
|
50 |
| - @echo -e '\n\033[1mSupported targets:\033[0m\n' |
| 89 | + @echo -e '\n\033[1mTargets:\033[0m\n' |
51 | 90 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
|
52 | 91 | | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[33m%-23s\033[0m %s\n", $$1, $$2}'
|
| 92 | + @echo -e '\n\033[1mVariables:\033[0m\n' |
| 93 | + @grep -E '^ifdef [A-Z_]+ .*?## .*$$' $(abspath $(lastword $(MAKEFILE_LIST))) \ |
| 94 | + | sed 's/ifdef //' \ |
| 95 | + | awk 'BEGIN {FS = " .*?## "}; {printf " \033[32m%-14s\033[0m %s\n", $$1, $$2}' |
53 | 96 | @echo -e ''
|
54 |
| - @echo -e '\033[90mGenerated by GoMakeGen 1.5.1\033[0m\n' |
| 97 | + @echo -e '\033[90mGenerated by GoMakeGen 2.2.0\033[0m\n' |
55 | 98 |
|
56 | 99 | ################################################################################
|
0 commit comments