evoldoers / biomake

GNU-Make-like utility for managing builds and complex workflows
BSD 3-Clause "New" or "Revised" License
102 stars 9 forks source link

Target-specific variables unsupported or broken #79

Open rulatir opened 4 years ago

rulatir commented 4 years ago

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.

ihh commented 4 years ago

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.

rulatir commented 4 years ago

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.

ihh commented 4 years ago

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.