The setup is a Makefile with the following content (inspired by the answer https://stackoverflow.com/a/20714468/185475):
prerule: VALUE = Hello
prerule:
@echo "in prerule"
@echo ${VALUE}
record: prerule
@echo "in record"
@echo ${VALUE}
I would like to define a variable in one rule, which is used as a prerequisite for a different rule (or actual a set of rules). With the current setup, the following output is generated:
$ make record
in prerule
Hello
in record
$
What I would like to have as output is the following:
$ make record
in prerule
Hello
in record
Hello
$