Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot specify multiple targets using a variable #82

Open
rulatir opened this issue Oct 8, 2020 · 0 comments
Open

Cannot specify multiple targets using a variable #82

rulatir opened this issue Oct 8, 2020 · 0 comments

Comments

@rulatir
Copy link

rulatir commented Oct 8, 2020

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
@rulatir rulatir changed the title Cannot specify multiple targets with a variable Cannot specify multiple targets using a variable Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant