11# ###############################################################################
22
3- # This Makefile generated by GoMakeGen 2. 3.0 using next command:
3+ # This Makefile generated by GoMakeGen 3.0.2 using next command:
44# gomakegen --mod .
55#
66# More info: https://kaos.sh/gomakegen
77
88# ###############################################################################
99
10- export GO111MODULE =on
11-
1210ifdef VERBOSE # # Print verbose information (Flag)
1311VERBOSE_FLAG = -v
1412endif
1513
16- COMPAT ?= 1.18
14+ COMPAT ?= 1.19
1715MAKEDIR = $(dir $(realpath $(firstword $(MAKEFILE_LIST ) ) ) )
1816GITREV ?= $(shell test -s $(MAKEDIR ) /.git && git rev-parse --short HEAD)
1917
2018# ###############################################################################
2119
2220.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
2422
2523# ###############################################################################
2624
2725all : sslcli # # Build all binaries
2826
2927sslcli :
30- go build $(VERBOSE_FLAG ) -ldflags=" -X main.gitrev=$( GITREV) " sslcli.go
28+ @echo " [36;1mBuilding sslcli…[0m"
29+ @go build $(VERBOSE_FLAG ) -ldflags=" -X main.gitrev=$( GITREV) " sslcli.go
3130
3231install : # # Install all binaries
33- cp sslcli /usr/bin/sslcli
32+ @echo " [36;1mInstalling binaries…[0m"
33+ @cp sslcli /usr/bin/sslcli
3434
3535uninstall : # # Uninstall all binaries
36- rm -f /usr/bin/sslcli
36+ @echo " [36;1mRemoving installed binaries…[0m"
37+ @rm -f /usr/bin/sslcli
3738
3839init : mod-init # # Initialize new module
3940
@@ -44,57 +45,70 @@ update: mod-update ## Update dependencies to the latest versions
4445vendor : mod-vendor # # Make vendored copy of dependencies
4546
4647mod-init :
48+ @echo " [37m[1/2][0m [36;1mModules initialization…[0m"
4749ifdef MODULE_PATH # # Module path for initialization (String)
48- go mod init $(MODULE_PATH)
50+ @ go mod init $(MODULE_PATH)
4951else
50- go mod init
52+ @ go mod init
5153endif
5254
55+ @echo "[37m[2/2][0m [36;1mDependencies cleanup…[0m"
5356ifdef 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)
5558else
56- go mod tidy $(VERBOSE_FLAG)
59+ @ go mod tidy $(VERBOSE_FLAG)
5760endif
5861
5962mod-update :
63+ @echo " [37m[1/4][0m [36;1mUpdating dependencies…[0m"
6064ifdef UPDATE_ALL # # Update all dependencies (Flag)
61- go get -u $(VERBOSE_FLAG) all
65+ @ go get -u $(VERBOSE_FLAG) all
6266else
63- go get -u $(VERBOSE_FLAG) ./...
67+ @ go get -u $(VERBOSE_FLAG) ./...
6468endif
6569
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"
6674ifdef COMPAT
67- go mod tidy $(VERBOSE_FLAG) -compat=$(COMPAT)
75+ @ go mod tidy $(VERBOSE_FLAG) -compat=$(COMPAT)
6876else
69- go mod tidy $(VERBOSE_FLAG)
77+ @ go mod tidy $(VERBOSE_FLAG)
7078endif
7179
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) || :
7382
7483mod-download :
75- go mod download
84+ @echo " [36;1mDownloading dependencies…[0m"
85+ @go mod download
7686
7787mod-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 ) || :
7990
8091fmt : # # 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 {} \;
8294
8395vet : # # 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 ./...
8598
8699clean : # # Remove generated files
87- rm -f sslcli
100+ @echo " [36;1mRemoving built binaries…[0m"
101+ @rm -f sslcli
88102
89103help : # # Show this info
90104 @echo -e ' \n\033[1mTargets:\033[0m\n'
91105 @grep -E ' ^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST ) \
92- | awk ' BEGIN {FS = ":.*?## "}; {printf " \033[33m%-14s \033[0m %s\n", $$1, $$2}'
106+ | awk ' BEGIN {FS = ":.*?## "}; {printf " \033[33m%-9s \033[0m %s\n", $$1, $$2}'
93107 @echo -e ' \n\033[1mVariables:\033[0m\n'
94108 @grep -E ' ^ifdef [A-Z_]+ .*?## .*$$' $(abspath $(lastword $(MAKEFILE_LIST ) ) ) \
95109 | 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}'
97111 @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'
99113
100114# ###############################################################################
0 commit comments