Re: variable reassign value in same makefile

Tony Theodore <[email protected]> Fri, 5 Apr 2024 18:09:56 +1100
Newsgroups gmane.comp.gnu.make.general
Message-ID <[email protected]>

> On 4 Apr 2024, at 18:10, anand akhare <[email protected]> wrote:
> 
> Hello Tony
>     I am looking for confirmation if this is expected behavior. Target specific variables will not have visibility outside of its recipe. I am using VAR variable across makefile.

I’m out of my depth. Five years ago I could hold make’s two-phase processing in my head, but now reasoning about global variables is beyond me.

Let alone mutating meta-global variables across makefiles - I generally try to reduce the scope of variables and pass them explicitly with function calls or a `$(MAKE) foo VAR=bar` in a subshell call.

Cheers,

Tony