@@ -42,7 +42,13 @@ for_each_kv = $(foreach item,$2,$(eval $(call $1,$(word 1,$(subst =, ,$(item))),
4242# variables: https://stackoverflow.com/questions/54726457
4343export PATH := $(CURDIR ) /$(bin_dir ) /tools:$(PATH )
4444
45- CTR =docker
45+ CTR ?= docker
46+ .PHONY : __require-ctr
47+ ifneq ($(shell command -v $(CTR ) >/dev/null || echo notfound) ,)
48+ __require-ctr :
49+ @:$(error "$(CTR ) (or set CTR to a docker-compatible tool) " )
50+ endif
51+ NEEDS_CTR = __require-ctr
4652
4753tools :=
4854# https://github.com/helm/helm/releases
@@ -153,7 +159,7 @@ ADDITIONAL_TOOLS ?=
153159tools += $(ADDITIONAL_TOOLS )
154160
155161# https://go.dev/dl/
156- VENDORED_GO_VERSION := 1.22.4
162+ VENDORED_GO_VERSION := 1.22.5
157163
158164# Print the go version which can be used in GH actions
159165.PHONY : print-go-version
@@ -241,8 +247,13 @@ detected_vendoring := $(findstring vendor-go,$(MAKECMDGOALS))$(shell [ -f $(bin_
241247export VENDOR_GO ?= $(detected_vendoring )
242248
243249ifeq ($(VENDOR_GO ) ,)
250+ .PHONY : __require-go
251+ ifneq ($(shell command -v go >/dev/null || echo notfound) ,)
252+ __require-go :
253+ @:$(error "$(GO ) (or run 'make vendor-go') " )
254+ endif
244255GO := go
245- NEEDS_GO := #
256+ NEEDS_GO = __require-go
246257else
247258export GOROOT := $(CURDIR ) /$(bin_dir ) /tools/goroot
248259export PATH := $(CURDIR ) /$(bin_dir ) /tools/goroot/bin:$(PATH )
@@ -363,10 +374,10 @@ $(call for_each_kv,go_dependency,$(go_dependencies))
363374# File downloads #
364375# #################
365376
366- go_linux_amd64_SHA256SUM =ba79d4526102575196273416239cca418a651e049c2b099f3159db85e7bade7d
367- go_linux_arm64_SHA256SUM =a8e177c354d2e4a1b61020aca3562e27ea3e8f8247eca3170e3fa1e0c2f9e771
368- go_darwin_amd64_SHA256SUM =c95967f50aa4ace34af0c236cbdb49a9a3e80ee2ad09d85775cb4462a5c19ed3
369- go_darwin_arm64_SHA256SUM =242b78dc4c8f3d5435d28a0d2cec9b4c1aa999b601fb8aa59fb4e5a1364bf827
377+ go_linux_amd64_SHA256SUM =904b924d435eaea086515bc63235b192ea441bd8c9b198c507e85009e6e4c7f0
378+ go_linux_arm64_SHA256SUM =8d21325bfcf431be3660527c1a39d3d9ad71535fabdf5041c826e44e31642b5a
379+ go_darwin_amd64_SHA256SUM =95d9933cdcf45f211243c42c7705c37353cccd99f27eb4d8e2d1bf2f4165cb50
380+ go_darwin_arm64_SHA256SUM =4cd1bcb05be03cecb77bccd765785d5ff69d79adf4dd49790471d00c06b41133
370381
371382.PRECIOUS : $(DOWNLOAD_DIR ) /tools/go@$(VENDORED_GO_VERSION ) _$(HOST_OS ) _$(HOST_ARCH ) .tar.gz
372383$(DOWNLOAD_DIR ) /tools/go@$(VENDORED_GO_VERSION ) _$(HOST_OS ) _$(HOST_ARCH ) .tar.gz : | $(DOWNLOAD_DIR ) /tools
@@ -604,10 +615,7 @@ $(DOWNLOAD_DIR)/tools/preflight@$(PREFLIGHT_VERSION)_linux_$(HOST_ARCH): | $(DOW
604615missing =$(shell (command -v curl >/dev/null || echo curl) \
605616 && (command -v sha256sum >/dev/null || command -v shasum >/dev/null || echo sha256sum) \
606617 && (command -v git >/dev/null || echo git) \
607- && (command -v rsync >/dev/null || echo rsync) \
608- && ([ -n "$(findstring vendor-go,$(MAKECMDGOALS ) ,) " ] \
609- || command -v $(GO ) >/dev/null || echo "$(GO ) (or run 'make vendor-go')") \
610- && (command -v $(CTR ) >/dev/null || echo "$(CTR ) (or set CTR to a docker-compatible tool)"))
618+ && (command -v rsync >/dev/null || echo rsync))
611619ifneq ($(missing ) ,)
612620$(error Missing required tools : $(missing ) )
613621endif
@@ -616,34 +624,3 @@ endif
616624# # Download and setup all tools
617625# # @category [shared] Tools
618626tools : $(tools_paths )
619-
620- self_file := $(dir $(lastword $(MAKEFILE_LIST ) ) ) /00_mod.mk
621-
622- # see https://stackoverflow.com/a/53408233
623- sed_inplace := sed -i''
624- ifeq ($(HOST_OS ) ,darwin)
625- sed_inplace := sed -i ''
626- endif
627-
628- # This target is used to learn the sha256sum of the tools. It is used only
629- # in the makefile-modules repo, and should not be used in any other repo.
630- .PHONY : tools-learn-sha
631- tools-learn-sha : | $(bin_dir )
632- rm -rf ./$(bin_dir ) /
633- mkdir -p ./$(bin_dir ) /scratch/
634- $(eval export LEARN_FILE=$(CURDIR ) /$(bin_dir ) /scratch/learn_tools_file)
635- echo -n " " > " $( LEARN_FILE) "
636-
637- HOST_OS=linux HOST_ARCH=amd64 $(MAKE) tools
638- HOST_OS=linux HOST_ARCH=arm64 $(MAKE) tools
639- HOST_OS=darwin HOST_ARCH=amd64 $(MAKE) tools
640- HOST_OS=darwin HOST_ARCH=arm64 $(MAKE) tools
641-
642- HOST_OS=linux HOST_ARCH=amd64 $(MAKE) vendor-go
643- HOST_OS=linux HOST_ARCH=arm64 $(MAKE) vendor-go
644- HOST_OS=darwin HOST_ARCH=amd64 $(MAKE) vendor-go
645- HOST_OS=darwin HOST_ARCH=arm64 $(MAKE) vendor-go
646-
647- while read p; do \
648- $(sed_inplace) "$$p" $(self_file); \
649- done <"$(LEARN_FILE)"
0 commit comments