Pregunta

How to assign or declare variable in target specific?

Here i had try this example.

foo = welcome

all: foo = hello
    echo $(foo)

But i get commands commence before first target. Stop.

¿Fue útil?

Solución

You can't have a target-specific assignment and a rule definition at the same time. You have to separate them:

all: foo = hello
all:
         echo $(foo)

Your version creates a target all which has three prerequisites: foo, =, and hello.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top