Firstly, apologies for incorrect use of make terms/speak - I'm a hacker ;-)
We're trying use variable settings defined in a target specific rules within the target's prerequisite list. It doesn't appear that
the variables settings are actually valid/applied until the body of the target - the command section.
Here a snippet of code which exhibits the issue:
BLOCK= top
.PHONY: Lint-Reuse
Lint-Reuse: DISCIPLINE=Lint
Lint-Reuse: GOAL=Reuse
Lint-Reuse: MILESTONE=3_Analysis
Lint-Reuse: $(MILESTONE)/$(BLOCK)/$(DISCIPLINE)-$(GOAL)/output
$(MILESTONE)/$(BLOCK)/$(DISCIPLINE)-$(GOAL)/output: $(BLOCK)/rules/$(BLOCK)_$(DISCIPLINE).f
@echo "do something .."
$(TOUCH) $@
We'd expect the prerequisite "$(BLOCK)/rules/$(BLOCK)_$(DISCIPLINE).f" to resolve to "top/rules/top_Lint.f" however Make resolves it to "top/rules/top_.f" which doesn't
exist and and thus Make fails.
Any help in getting something like this to work would be much appreciated, if this type of approach can't be used and alternative concise implementation would suit us just as
well.
Best Regards,
-Frazer