help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Evaluation and expansion


From: Paul Smith
Subject: Re: Evaluation and expansion
Date: Wed, 07 Jun 2023 09:31:03 -0400
User-agent: Evolution 3.48.2 (by Flathub.org)

On Wed, 2023-06-07 at 00:14 +0200, Bartłomiej Wójcik wrote:
> I also found that in the *immediate* context the expansion is done
> before evaluation, and for the *deferred* context, it is the
> opposite. But it is also stated that in the *immediate *context, the
> expansion is done while parsing, which would be contradictory,
> because as I understand the evaluation is the process of parsing and
> internalizating.

Evaluating a variable assignment just means that the variable is
assigned to some value inside make's memory: that's the
"internalizing".

So:

    FOO = bar

evaluates to setting the make variable FOO to the value bar.  And this:

    bar = baz
    FOO = $(bar)

evaluates to setting the make variable FOO to the value $(bar): no
expansion is performed here, but the variable assignment is still
evaluated.  And this:

    bar = baz
    FOO := $(bar)

evaluates to setting the make variable FOO to the value baz: here
$(bar) is expanded immediately.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]