1
1
# ###############################################################################
2
2
3
- # This Makefile generated by GoMakeGen 2. 3.0 using next command:
3
+ # This Makefile generated by GoMakeGen 3.0.2 using next command:
4
4
# gomakegen --mod .
5
5
#
6
6
# More info: https://kaos.sh/gomakegen
7
7
8
8
# ###############################################################################
9
9
10
- export GO111MODULE =on
11
-
12
10
ifdef VERBOSE # # Print verbose information (Flag)
13
11
VERBOSE_FLAG = -v
14
12
endif
15
13
16
- COMPAT ?= 1.18
14
+ COMPAT ?= 1.19
17
15
MAKEDIR = $(dir $(realpath $(firstword $(MAKEFILE_LIST ) ) ) )
18
16
GITREV ?= $(shell test -s $(MAKEDIR ) /.git && git rev-parse --short HEAD)
19
17
20
18
# ###############################################################################
21
19
22
20
.DEFAULT_GOAL := help
23
- .PHONY = fmt vet all clean deps update init vendor mod-init mod-update mod-download mod-vendor help
21
+ .PHONY = fmt vet all install uninstall clean deps update init vendor mod-init mod-update mod-download mod-vendor help
24
22
25
23
# ###############################################################################
26
24
27
25
all : jira-reindex-runner # # Build all binaries
28
26
29
27
jira-reindex-runner :
30
- go build $(VERBOSE_FLAG ) -ldflags=" -X main.gitrev=$( GITREV) " jira-reindex-runner.go
28
+ @echo " [36;1mBuilding jira-reindex-runner…[0m"
29
+ @go build $(VERBOSE_FLAG ) -ldflags=" -X main.gitrev=$( GITREV) " jira-reindex-runner.go
31
30
32
31
install : # # Install all binaries
33
- cp jira-reindex-runner /usr/bin/jira-reindex-runner
32
+ @echo " [36;1mInstalling binaries…[0m"
33
+ @cp jira-reindex-runner /usr/bin/jira-reindex-runner
34
34
35
35
uninstall : # # Uninstall all binaries
36
- rm -f /usr/bin/jira-reindex-runner
36
+ @echo " [36;1mRemoving installed binaries…[0m"
37
+ @rm -f /usr/bin/jira-reindex-runner
37
38
38
39
init : mod-init # # Initialize new module
39
40
@@ -44,57 +45,70 @@ update: mod-update ## Update dependencies to the latest versions
44
45
vendor : mod-vendor # # Make vendored copy of dependencies
45
46
46
47
mod-init :
48
+ @echo " [37m[1/2][0m [36;1mModules initialization…[0m"
47
49
ifdef MODULE_PATH # # Module path for initialization (String)
48
- go mod init $(MODULE_PATH)
50
+ @ go mod init $(MODULE_PATH)
49
51
else
50
- go mod init
52
+ @ go mod init
51
53
endif
52
54
55
+ @echo "[37m[2/2][0m [36;1mDependencies cleanup…[0m"
53
56
ifdef COMPAT # # Compatible Go version (String)
54
- go mod tidy $(VERBOSE_FLAG) -compat=$(COMPAT) -go=$(COMPAT)
57
+ @ go mod tidy $(VERBOSE_FLAG) -compat=$(COMPAT) -go=$(COMPAT)
55
58
else
56
- go mod tidy $(VERBOSE_FLAG)
59
+ @ go mod tidy $(VERBOSE_FLAG)
57
60
endif
58
61
59
62
mod-update :
63
+ @echo " [37m[1/4][0m [36;1mUpdating dependencies…[0m"
60
64
ifdef UPDATE_ALL # # Update all dependencies (Flag)
61
- go get -u $(VERBOSE_FLAG) all
65
+ @ go get -u $(VERBOSE_FLAG) all
62
66
else
63
- go get -u $(VERBOSE_FLAG) ./...
67
+ @ go get -u $(VERBOSE_FLAG) ./...
64
68
endif
65
69
70
+ @echo "[37m[2/4][0m [36;1mStripping toolchain info…[0m"
71
+ @grep -q 'toolchain ' go.mod && go mod edit -toolchain=none || :
72
+
73
+ @echo "[37m[3/4][0m [36;1mDependencies cleanup…[0m"
66
74
ifdef COMPAT
67
- go mod tidy $(VERBOSE_FLAG) -compat=$(COMPAT)
75
+ @ go mod tidy $(VERBOSE_FLAG) -compat=$(COMPAT)
68
76
else
69
- go mod tidy $(VERBOSE_FLAG)
77
+ @ go mod tidy $(VERBOSE_FLAG)
70
78
endif
71
79
72
- test -d vendor && rm -rf vendor && go mod vendor $(VERBOSE_FLAG) || :
80
+ @echo "[37m[4/4][0m [36;1mUpdating vendored dependencies…[0m"
81
+ @test -d vendor && rm -rf vendor && go mod vendor $(VERBOSE_FLAG) || :
73
82
74
83
mod-download :
75
- go mod download
84
+ @echo " [36;1mDownloading dependencies…[0m"
85
+ @go mod download
76
86
77
87
mod-vendor :
78
- rm -rf vendor && go mod vendor $(VERBOSE_FLAG )
88
+ @echo " [36;1mVendoring dependencies…[0m"
89
+ @rm -rf vendor && go mod vendor $(VERBOSE_FLAG ) || :
79
90
80
91
fmt : # # Format source code with gofmt
81
- find . -name " *.go" -exec gofmt -s -w {} \;
92
+ @echo " [36;1mFormatting sources…[0m"
93
+ @find . -name " *.go" -exec gofmt -s -w {} \;
82
94
83
95
vet : # # Runs 'go vet' over sources
84
- go vet -composites=false -printfuncs=LPrintf,TLPrintf,TPrintf,log.Debug,log.Info,log.Warn,log.Error,log.Critical,log.Print ./...
96
+ @echo " [36;1mRunning 'go vet' over sources…[0m"
97
+ @go vet -composites=false -printfuncs=LPrintf,TLPrintf,TPrintf,log.Debug,log.Info,log.Warn,log.Error,log.Critical,log.Print ./...
85
98
86
99
clean : # # Remove generated files
87
- rm -f jira-reindex-runner
100
+ @echo " [36;1mRemoving built binaries…[0m"
101
+ @rm -f jira-reindex-runner
88
102
89
103
help : # # Show this info
90
104
@echo -e ' \n\033[1mTargets:\033[0m\n'
91
105
@grep -E ' ^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST ) \
92
- | awk ' BEGIN {FS = ":.*?## "}; {printf " \033[33m%-21s \033[0m %s\n", $$1, $$2}'
106
+ | awk ' BEGIN {FS = ":.*?## "}; {printf " \033[33m%-9s \033[0m %s\n", $$1, $$2}'
93
107
@echo -e ' \n\033[1mVariables:\033[0m\n'
94
108
@grep -E ' ^ifdef [A-Z_]+ .*?## .*$$' $(abspath $(lastword $(MAKEFILE_LIST ) ) ) \
95
109
| sed ' s/ifdef //' \
96
- | awk ' BEGIN {FS = " .*?## "}; {printf " \033[32m%-14s \033[0m %s\n", $$1, $$2}'
110
+ | awk ' BEGIN {FS = " .*?## "}; {printf " \033[32m%-11s \033[0m %s\n", $$1, $$2}'
97
111
@echo -e ' '
98
- @echo -e ' \033[90mGenerated by GoMakeGen 2. 3.0\033[0m\n'
112
+ @echo -e ' \033[90mGenerated by GoMakeGen 3.0.2 \033[0m\n'
99
113
100
114
# ###############################################################################
0 commit comments