bug-make
[Top][All Lists]
Advanced

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

[bug #46585] variables being auto-exported to the environment if it was


From: Brian Vandenberg
Subject: [bug #46585] variables being auto-exported to the environment if it was set in the environment
Date: Wed, 02 Dec 2015 02:06:53 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; Trident/7.0; rv:11.0) like Gecko

URL:
  <http://savannah.gnu.org/bugs/?46585>

                 Summary: variables being auto-exported to the environment if
it was set in the environment
                 Project: make
            Submitted by: phantal
            Submitted on: Wed 02 Dec 2015 02:06:52 AM GMT
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: 4.1
        Operating System: Any
           Fixed Release: None
           Triage Status: None

    _______________________________________________________

Details:

The short version:

* If a variable is set in the environment then you set the variable in a
makefile without the "export" keyword, it's auto-exported to the environment.
* If the variable is *not* set in the environment, the value set in the
makefile is *not* exported to the environment.


.RECIPEPREFIX := >

BLAH := from makefile

$(warning ${BLAH}, $(shell echo $$BLAH))

all:
> @echo In $@: ${BLAH}, should be from makefile
> @echo In $@: $$BLAH, should be from env
> @echo In $@: $(shell echo $$BLAH), should be from env


Executed with:

~ env BLAH="from env" gmake -f /tmp/makefile
/tmp/makefile:5: from makefile, from env
In all: from makefile, should be from makefile
In all: from makefile, should be from env
In all: from env, should be from env
~ gmake -f /tmp/makefile
/tmp/makefile:5: from makefile, 
In all: from makefile, should be from makefile
In all: , should be from env
In all: , should be from env

I was under the impression that it would only export to the shell if you did
one of the following:

* "export" on a line by itself, forcing all variables to auto-export
* "export BLAH", or some variation thereof

... but it looks as though it's exporting always if it was set in the original
environment make was executed with.




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?46585>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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