I have a Make variable:
PASSWORD:=$(shell vault read -field=password test/password)
If vault is not installed, make
Maybe this idea should work:
X!=lsx /
all:
ifeq (${.SHELLSTATUS},0)
@echo OK
else
@exit 1
endif
For example you can create a check: PHONY-target which is needed by every (other) target.
Explanation see here:
After the shell function or ‘!=’ assignment operator is used, its exit status is placed in the .SHELLSTATUS variable.
The X=$(shell ls /) doesn't work but IMHO should.