Based on @John Bollinger answer + googling about colorizing error outputs from make I've stumbled across following solution in the makefile documentation:
ifdef REVISION
$(info "REVISION is ${REVISION}")
ERR = :
else
ERR = $(error "REVISION is unspecified...")
endif
all: err <some other prerequisities>
.PHONY: err
err: ; ERR
.PHONY: clear
clear:
rm -r build
According to my understanding, the first prerequisite "err" in the "all" target gets executed first. From that perspective the "ERR" variable is expanded and executed.
However, this solution might not solve what @John Bollinger pointed out and that is if someone tries to execute an intermediate file or so.
However, my case is, that the REV propagates into source code from makefile via CFLAGS and if it's not defined, the code doesn't get compiled, as there is detection for revision. So both solutions are acceptable for me. :-)