help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exported variable not being set when using gnu make


From: Paul D. Smith
Subject: Re: Exported variable not being set when using gnu make
Date: Fri, 27 Aug 2004 14:22:11 -0400

%% "Kedziora, Rebecca" <address@hidden> writes:

  kr> I can see that it is using the sh shell but I need for it to use
  kr> the korn shell.  I tried different variations to do this and it
  kr> will not set the CVSROOT to which I can't check out modules.

GNU make, as required by POSIX, always invokes /bin/sh to run commands.

If you want a different shell, set the make variable SHELL to something
else:

    SHELL = /bin/ksh


If I were you, I'd not do this (it's not portable; ksh is not available
everywhere) and instead fix your commands so they only required a POSIX
shell and didn't require ksh.

In the particular instance you posted about you can do that simply by
making the export a separate operation; /bin/sh doesn't support doing it
in one command:

  J2EE_CVS= CVSROOT=:pserver:$(shell whoami)@cvchost.bmc.com:/home/cvs/src; 
export CVSROOT


Alternatively you could do this:

  J2EE_CVS= CVSROOT=:pserver:$(shell whoami)@cvchost.bmc.com:/home/cvs/src

  get_j2ee:
        $(J2EE_CVS) cvs co -A j2ee

which would also work with all POSIX shells.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

[Prev in Thread] Current Thread [Next in Thread]