Re: Clarification on :::= Variable Assignment Operator?
"David A. Wheeler" <[email protected]> Fri, 4 Feb 2022 11:50:03 -0500
| Newsgroups | gmane.comp.gnu.make.devel |
|---|---|
| Message-ID | <[email protected]> |
> On Feb 4, 2022, at 9:47 AM, Paul Smith <[email protected]> wrote: > > On Thu, 2022-02-03 at 12:43 -0800, Jon Forrest wrote: >> Several places in variable.c and variable.h mention the ':::=' >> variable assignment operator, and describe it as >> a Posix addition. However, I can't find any mention of it anywhere on >> the Internet or in the Gmake manual. > >> What I did find were lots of mentions of the '::=' operator. > > That exists, too. > >> Is ':::=' a typo? > > No, it's real. You can find more info here: > > https://austingroupbugs.net/view.php?id=1471 > > although there was a lengthy discussion on the mailing list after that > as well. You can blame me :-). There's a need in makefiles to assign variables (macros) so that the expansions happen once instead of recursively in every use. Large makefiles start to hit exponential slowdowns if you can't deal with it. Unfortunately, GNU make and BSD make's := have significantly different semantics, making standardization a challenge. The proposed solution was to create ::= with GNU make := semantics, so that there would be an operation that would work the same everywhere. --- David A. Wheeler