Lavya
Lavya

Reputation: 1575

Makefile: difference between := and ::= assignment operators

Gnu Makefile shows two symbols for immediate expansion, as follows:

immediate := immediate
immediate ::= immediate

Is there a difference between these two?

reference: gnu makefile manual section 3.7

Upvotes: 5

Views: 1921

Answers (1)

Beta
Beta

Reputation: 99094

From section 6.2:

Simply expanded variables are defined by lines using ‘:=’ or ‘::=’ (see Setting Variables). Both forms are equivalent in GNU make; however only the ‘::=’ form is described by the POSIX standard (support for ‘::=’ was added to the POSIX standard in 2012, so older versions of make won’t accept this form either).

Upvotes: 7

Related Questions