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/ _______________________________________________ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make