shell function and environment

Posted by Michael on Stack Overflow See other posts from Stack Overflow or by Michael
Published on 2010-05-15T04:33:58Z Indexed on 2010/05/15 4:44 UTC
Read the original article Hit count: 337

How in Makefile export variable first then make another variable's expansion?

somevar := apple
export somevar
update = $(shell perl -e 'print "$$ENV{somevar}"')
all:
    @echo $(update)

For some reason the expansion takes place first, then export. As a result the output is empty.

© Stack Overflow or respective owner

Related posts about makefile

Related posts about environment-variables