help-make
[Top][All Lists]
Advanced

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

Re: How to privately export a variable?


From: Paul Smith
Subject: Re: How to privately export a variable?
Date: Sun, 08 Jan 2023 08:55:51 -0500
User-agent: Evolution 3.46.2 (by Flathub.org)

On Sun, 2023-01-08 at 21:14 +0900, Masahiro Yamada wrote:
> I expected "private export" would mean
> "privately export", but it is the same as "export".
> The variable is exported not only to 'foo',
> but also to 'bar' and 'baz'.

This is a bug, which has been fixed for the next release:

https://savannah.gnu.org/bugs/?61463

In the meantime it will work to separate the export from the private,
like this:

    FOR_FOO := global

    foo: private export FOR_FOO = $(p_FOO)
    foo: private p_FOO := 1

    foo: bar baz
    foo bar baz: ; @echo $@: $$FOR_FOO

(the "private" on the first foo: line doesn't have the desired effect
until the above bug is fixed but I left it there anyway).

Note it's of course critically important to use "=" in the export
assignment, not ":=".



reply via email to

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