@@ -37,6 +37,12 @@ TARGETDIR=$(CURRENTDIR)target
3737# Directory where to store binary utility tools
3838BINUTIL =$(TARGETDIR ) /binutil
3939
40+ # sed argument for in-place substitutions
41+ SEDINPLACE =-i
42+ ifeq ($(shell uname -s) ,Darwin)
43+ SEDINPLACE=-i ''
44+ endif
45+
4046# GO lang path
4147ifeq ($(GOPATH ) ,)
4248 # extract the GOPATH
@@ -61,7 +67,7 @@ GOFMT=$(shell which gofmt)
6167GOTEST =$(GO ) test
6268GODOC=GOPATH =$(GOPATH ) $(shell which godoc)
6369GOLANGCILINT =$(BINUTIL ) /golangci-lint
64- GOLANGCILINTVERSION =v2.11.3
70+ GOLANGCILINTVERSION =v2.11.4
6571
6672# Directory containing the source code
6773SRCDIR =./
@@ -219,14 +225,14 @@ updateall: updatego updatelint updatemod
219225updatego :
220226 $(eval LAST_GO_TOOLCHAIN=$(shell curl -s https://go.dev/dl/ | grep -oE 'go[0-9]+\.[0-9]+\.[0-9]+\.linux-amd64\.tar\.gz' | head -n 1 | grep -oE 'go[0-9]+\.[0-9]+\.[0-9]+') )
221227 $(eval LAST_GO_VERSION=$(shell echo ${LAST_GO_TOOLCHAIN} | grep -oE '[0-9]+\.[0-9]+') )
222- sed --in-place=.bak " s|^go [0-9]*\.[0-9]*$$ |go ${LAST_GO_VERSION} |g" go.mod
223- sed --in-place=.bak " s|^toolchain go[0-9]*\.[0-9]*\.[0-9]*$$ |toolchain ${LAST_GO_TOOLCHAIN} |g" go.mod
228+ sed $( SEDINPLACE ) " s|^go [0-9]*\.[0-9]*$$ |go ${LAST_GO_VERSION} |g" go.mod
229+ sed $( SEDINPLACE ) " s|^toolchain go[0-9]*\.[0-9]*\.[0-9]*$$ |toolchain ${LAST_GO_TOOLCHAIN} |g" go.mod
224230
225231# Update linter version
226232.PHONY : updatelint
227233updatelint :
228234 $(eval LAST_GOLANGCILINT_VERSION=$(shell curl -sL https://github.com/golangci/golangci-lint/releases/latest | sed -n 's/.* <title>Release \(v[0-9]* \.[0-9]* \.[0-9]* \) .* /\1/p') )
229- sed --in-place=.bak " s|^GOLANGCILINTVERSION=v[0-9]*\.[0-9]*\.[0-9]*$$ |GOLANGCILINTVERSION=${LAST_GOLANGCILINT_VERSION} |g" Makefile
235+ sed $( SEDINPLACE ) " s|^GOLANGCILINTVERSION=v[0-9]*\.[0-9]*\.[0-9]*$$ |GOLANGCILINTVERSION=${LAST_GOLANGCILINT_VERSION} |g" Makefile
230236
231237# Update dependencies
232238.PHONY : updatemod
0 commit comments