For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > February 2006 > how to access environmental variables from shell in makefile









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author how to access environmental variables from shell in makefile
charlotte

2006-02-27, 9:57 pm

plz tell me how do i set a variable in a shell and access it in a
makefile..
plzzz tell me..

Barry Margolin

2006-02-27, 9:57 pm

In article <1141092845.542684.158480@v46g2000cwv.googlegroups.com>,
"charlotte" <Joshi.Bakul@gmail.com> wrote:

> plz tell me how do i set a variable in a shell and access it in a
> makefile..
> plzzz tell me..


Set environment variable:

var=value
export var

Access it in a makefile:

target: dependency
echo $$var

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com