Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Declaring a global variable through a MakeFile

3,138 views
Skip to first unread message

Joe Mesa

unread,
Jul 7, 2000, 3:00:00 AM7/7/00
to
Hi,

I have been trying to set the PATH environment variable through a
MakeFile with no luck. To explain more PATH already is set to its
value outside the MakeFile. In order to use the gnu executables I have
to place the gnu directory before the Windows directory in the PATH.
I can do this easily in a .bat or .login but I was trying to do it
within the
MakeFile. So I wrote:

TOOLSDIR=$(shell cd ../../tools/gnu; pwd)
TMPPATH=$(TOOLSDIR):$(PATH)
PATH=$(TMPPATH)
export PATH

and I get the following error:
*** Recursive variable `PATH' references itself (eventually). Stop

Is there a way to do what I am trying or do I have to use a .bat or
.login
to accomplish what I want?

Thanks,
Joe

Paul D. Smith

unread,
Jul 7, 2000, 3:00:00 AM7/7/00
to Joe Mesa
Use := (simple assignment) instead of = (recursive assignment).

PATH := $(TMPPATH)

See the GNU make manual for a discussion of the differences.

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

0 new messages