tags 327154 +confirmed,upstream
severity 327154 minor
thanks

Hi,

        Invoke make as 'FOO=shell make FOO=cmdln' for the following
 Makefile. 

--8<---------------cut here---------------start------------->8---
all:
        @echo Foo is  $(FOO),$(shell echo $(FOO)),$$FOO,$(shell echo $$FOO)
--8<---------------cut here---------------end--------------->8---

        You can easily see that $(shell) doesn't have the same
 environment as a sub-process.

        As is explained in
 http://www.cmcrossroads.com/content/view/7657/268/ , this is bug
 https://savannah.gnu.org/bugs/?10593. Part of the reason this hasn't
 been fixed is that the obvious solution ('just do whatever you do for a
 rule') has a rather nasty consequence.  Suppose, I do the following: 

export FOO=$(shell echo fooey)

all:
    @echo FOO is $$FOO

What's the value of FOO in the rule for all?  In order to get the value
of FOO in the environment for all it has to be expanded which results in
a loop as FOO would have to be placed in the environment of the $(shell)
which requires getting the value of FOO and so on... 

GNU Make's developers opted for an easy way: they just don't even try to
fix the bug (for the moment). 


        manoj
-- 
Genius is one percent inspiration and ninety-nine percent
perspiration. Thomas Alva Edison
Manoj Srivastava <[EMAIL PROTECTED]> <http://www.debian.org/~srivasta/>  
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to