@@ -74,7 +74,7 @@ build/aws-stack.yml:
74
74
} else { \
75
75
print \
76
76
}\
77
- }' templates/aws-stack.yml | sed "s/%v/$(VERSION)/" > $@
77
+ }' templates/aws-stack.yml | $(SED) "s/%v/$(VERSION)/" > $@
78
78
79
79
# -----------------------------------------
80
80
# AMI creation with Packer
@@ -116,8 +116,8 @@ build/linux-arm64-ami.txt: packer-linux-arm64.output env-AWS_REGION
116
116
grep -Eo " $( AWS_REGION) : (ami-.+)" $< | cut -d' ' -f2 | xargs echo -n > $@
117
117
118
118
# NOTE: make removes the $ escapes, everything else is passed to the shell
119
- CURRENT_AGENT_VERSION_LINUX ?= $(shell sed -En 's/^AGENT_VERSION="?(.+?) "?$$/\1/p' packer/linux/scripts/install-buildkite-agent.sh)
120
- CURRENT_AGENT_VERSION_WINDOWS ?= $(shell sed -En 's/^\$$AGENT_VERSION = "(.+?) "$$/\1/p' packer/windows/scripts/install-buildkite-agent.ps1)
119
+ CURRENT_AGENT_VERSION_LINUX ?= $(shell $( SED ) -En 's/^AGENT_VERSION="?(.+?) "?$$/\1/p' packer/linux/scripts/install-buildkite-agent.sh)
120
+ CURRENT_AGENT_VERSION_WINDOWS ?= $(shell $( SED ) -En 's/^\$$AGENT_VERSION = "(.+?) "$$/\1/p' packer/windows/scripts/install-buildkite-agent.ps1)
121
121
122
122
print-agent-versions :
123
123
@echo Linux: $(CURRENT_AGENT_VERSION_LINUX )
@@ -235,9 +235,12 @@ AGENT_VERSION ?= $(shell curl -Lfs "https://buildkite.com/agent/releases/latest?
235
235
236
236
SED ?= sed
237
237
ifeq ($(shell uname) , Darwin)
238
- # Use GNU sed, not MacOS sed
239
- # Install with: brew install gsed
238
+ # Use GNU sed, not MacOS sed - required for extended regex support
239
+ # BSD sed (default on macOS) doesn't support the regex patterns used in this Makefile
240
240
SED = gsed
241
+ ifeq ($(shell command -v gsed >/dev/null 2>&1 && echo yes || echo no), no)
242
+ $(error GNU sed (gsed) is required on macOS but not found. Please install with : brew install gnu-sed)
243
+ endif
241
244
endif
242
245
243
246
bump-agent-version :
0 commit comments