evoldoers / biomake

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

Cannot specify multiple targets using a variable #82

Open rulatir opened 4 years ago

rulatir commented 4 years ago

Specifying multiple targets for a rule doesn't work if the targets are specified via a variable. Multiple targets written directly in the rule work. A single target in a variable also works.

This will fail with "no theoretical build path to target1" (it works with GNU Make):

targets := target1 target2

all: target1 target2

$(targets): somesource
    recipe

.PHONY: all

This works:

all: target1 target2

target1 target2: somesource
    recipe

.PHONY: all

And surprisingly this also works:

targets := just-one-target

all: just-one-target

$(targets): somesource
    recipe

.PHONY: all