Target-specific variables unsupported or broken
rulatir opened this issue · 3 comments
This GNU make feature is either unsupported or broken in biomake.
Simple assignments throw parse error. Recursive assignments are parsed but have no effect.
Makefile
:
main-target: variable = defined
main-target: dependency dependency-with-directly-defined-variable
cat $^ > $@
dependency:
echo "[" $(variable) "]" > $@
dependency-with-directly-defined-variable: directly_defined_variable = directly_defined
dependency-with-directly-defined-variable:
echo "[" $(directly_defined_variable) "]" > $@
main-target
built with GNU make:
[ defined ]
[ directly_defined ]
main-target
built with biomake:
[ ]
[ ]
Since the README lists "various ways of setting variables" among supported features, and doesn't mention target-specific variable values among unsupported features, I would expect this feature to work.
Thanks @rulatir and thanks for the clear test case. I have added a note to the README that this feature is missing. Not sure at the moment when we'll get a chance to add it, but in principle I wouldn't think it's too hard.
I wonder if this will be blocked by lack of support for multiple rules per target, given that the syntax for setting target-specific variables is rule-ish.
It shouldn't be blocked by that, per se. The Makefile parser could bring all that stuff together. It's more just a question of introducing these new assignments into the Prolog database somehow attached to these rules.