[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Exporting variable to $(shell).
From: |
Paul Smith |
Subject: |
Re: Exporting variable to $(shell). |
Date: |
Wed, 11 Jan 2017 10:45:05 -0500 |
On Wed, 2017-01-11 at 17:49 +0300, Sergey Organov wrote:
> It looks like exporting variables to $(shell) function
> doesn't work.
This is https://savannah.gnu.org/bugs/?10593
It should be made to work, but unfortunately it's not completely trivial
to fix, since you can have infinite loops like:
export ID = $(shell id -a)
var := $(shell echo hi)
Some sort of loop detection on variable expansion needs to be
implemented.
You need to explicitly provide the variables you need in the shell
function:
var := $(shell MY_VAR='$(MY_VAR)'; echo "value = $$MY_VAR")