On Thu, Jul 2, 2020 at 8:49 AM Jan Beulich <jbeul...@suse.com> wrote:
> is it really intended for "export"
> without any assignment done at the same time to change the origin of a
> previously undefined variable from "undefined" to "file"?

"export" without any assignment done at the same time sets the origin
to "environment".

export wom
introduces the variable to the env and set origin to environment.

export wom=
also assigns the value of the variable and sets the origin to "file".


> It doesn't
> change "default" to "file" for a variable with a default value, for
> comparison.

export CC=
sets origin to "file" because a new value from the file is assigned.

export CC
keeps origin intact because the value does not change.



> As to the use case - to be able to determine whether a variable has
> been given a non-default value, and for such a check to be independent
> of whether
> - -R was passed to make
> - export lives ahead or after the check
> a change in behavior would seem to be needed, as such a check can,
> afaict, only sensibly check for "undefined" and "default".

Can you post a sample makefile which demonstrates what you want to achieve?

regards, Dmitry

  • export vs $(o... Jan Beulich
    • Re: expo... Dmitry Goncharov via Bug reports and discussion for GNU make
      • Re: ... Jan Beulich
        • ... Paul Smith
          • ... Jan Beulich
            • ... Paul Smith
              • ... Andreas Schwab
        • ... Dmitry Goncharov via Bug reports and discussion for GNU make

Reply via email to