News for hackers. Stuff that matters.
Re:Makefiles – Best Practices by jgrahamc on Friday February 01, 2019 @12:07PM (#19055951)
If turns CFLAGS from a recursive variable to a simple one. Hence it will not be re-expanded every time it is used. This is a speed optimization.

    $ cat Makefile
    CFLAGS = -Wall
    $(info $(flavor CFLAGS))
    CFLAGS := $(CFLAGS)
    $(info $(flavor CFLAGS))
    $ make
    recursive
    simple
But TFA says that the author is using := to prevent a recursive definition. It's unclear why the author doesn't just += without doing = or := (unless they want the recursive to simple conversion I talk about above). My guess is the author sligthly misunderstood the handling of the environment inside a Makefile.

There are no comments on this comment yet.