How do I set more than one target specific variable?

If I try:

x: Y := foo Z := bar

I end up with Y = "foo Z := bar". There must be some syntax which will allow for multiple variables...

1 Answer 1


In GNU make you specify the target multiple times to accommodate the required number of variable assignments, like as:

x: Y := foo
x: Z := bar
  @echo Y=$(Y) -- Z=$(Z)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .