Alex Rivera | Logout

What's the difference between := and = in Makefile?

Asked 2011-02-02T20:38:08.430
236

For variable assignment in Make, I see := and = operator. What's the difference between them?

Edit
Report

1 Answer

129

This is described in the GNU Make documentation, in the section titled 6.2 The Two Flavors of Variables .

In short, variables defined with := are expanded once, but variables defined with = are expanded whenever they are used.

answered 2011-02-02T20:40:24.497

Your Answer