:= vs = in make macros

MakefileGnu MakeColon Equals

Makefile Problem Overview


> Possible Duplicate:
> https://stackoverflow.com/questions/448910/makefile-variable-assignment

I only know very basic makefile syntax, and was reading through another project's makefile and came across := for macro declaration. Why would they use that?

In other words, is there any difference between

MYMACRO = hi i'm a macro

and

MYMACRO := hi i'm a macro

?

Makefile Solutions


Solution 1 - Makefile

Variables defined with := in GNU make are expanded when they are defined rather than when they are used.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAaron YodaikenView Question on Stackoverflow
Solution 1 - MakefilesverreView Answer on Stackoverflow