:= vs = in make macros

Aaron Yodaiken picture Aaron Yodaiken · Jun 8, 2011 · Viewed 59.1k times · Source

Possible Duplicate:
What is the difference between the GNU Makefile variable assignments =, ?=, := and +=?

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

?

Answer

sverre picture sverre · Jun 8, 2011

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