Using environment variables [message #59199] |
Tue, 21 January 2003 11:59  |
Eclipse User |
|
|
|
Originally posted by: nomail.bob.com
It looks like this is still in plan but is it currently possible to specify
environment variables to used in the make command. Our current makefiles
havily use defined environment variables, however when I try to run this
with CDT the variables are not calculated. For instance if I set up an
external program, point it to echo and provide %SBD% as an argument (a
pre-defined variable) the program will return %SBD% not the required value
of that variable.
This is on win2000, sp3 with F1 of cdt installed, and now working thankfully
Cheers In advance
Steve
|
|
|
|
|
|
|
|
|
|
|
Re: Using environment variables [message #59757 is a reply to message #59734] |
Fri, 24 January 2003 09:29  |
Eclipse User |
|
|
|
Originally posted by: ash371952.hotmail.com
"Stephen Cox" <nomail@bob.com> wrote in message
news:b0r385$n6v$1@rogue.oti.com...
> I am using cygwin. echo is coming from /usr/cygbin/echo on windows 2000
> service pack 3. I'm not sure what is going on, but I'm sure echo is not
> being fed the correct environment variables within eclipse
> From the command prompt:
> echo $(SBD)
> $(SBD)
> echo %SBD%
> T:\cs
> echo %BOB% (doesnt exist)
> %BOB%
> echo $(BOB)
> $(BOB)
Yes, that's correct. Echo prints the text without substitution (%BOB% for
instance) if it does not recognize this format. I tried yesterday night the
same example on cygwin Win2000 computer and everything worked well. As far
as in your case for any macro format echo never substitutes macros, it seems
to me that it would also fail to substitute %PATH% or $(PATH) or $PATH as
well. Looks like it doesn't understand any macro substitution format. Could
you please try to use absolute path for echo command in your make file?
Could you please also try it for PATH ? In Windows echo is an embedded
command and I guess overrule the path call order.
>
> From within Eclipse:
> which echo
I think "which" just searches executable with this name in the path order.
If command shell then runs embedded version, you don't know about that.
So please try full path name to call cygwin echo command.
> /usr/bin/echo
> echo $(SBD)
> $(SBD)
> echo %SBD%
> %SBD%
> echo %BOB%
> %BOB%
> echo $(BOB)
> $(BOB)
>
> oh and just to note {} dont work either, they just get removed
> echo ${SBD}
> $SBD
>
> also set SBD from the command prompt returns
> SBD=T:\cs
> set SBD from within eclipse does not return anything at all
> where as set BOB from the command prompt returns
> Environment variable BOB not defined
>
> Thanks again for the help
>
>
> "Alex Chapiro" <ash371952@hotmail.com> wrote in message
> news:b0p875$i77$1@rogue.oti.com...
> > BTW, if I use the name of unknown environment variable, echo prints
> nothing.
> > So if my Makefile has something like that:
> > foo:
> >
> > echo $(BLA_BLA_BLA) HO_HO_HO
> >
> > then running "make foo"
> >
> > prints just
> >
> > HO_HO_HO
> >
> > (I didn't define environment variable BLA_BLA_BLA).
> >
> > You wrote that you see something like:
> >
> > $(BLA_BLA_BLA) HO_HO_HO
> >
> > I cannot understand this result.
> >
> >
> >
> > "Stephen Cox" <nomail@bob.com> wrote in message
> > news:b0ogp1$t0j$1@rogue.oti.com...
> > > echo $SBD gives me $SBD
> > > echo $(SBD) gives me $(SBD)
> > > Any other hints?
> > >
> > > "Alex Chapiro" <ash371952@hotmail.com> wrote in message
> > > news:b0m1nf$47f$1@rogue.oti.com...
> > > > > adding echo to the project make command and using %SBD% as the
build
> > > > target
> > > > > (or indeed setting the build command to echo %SBD% and using " "
> > > (space))
> > > > > produces
> > > > > echo %SBD%
> > > > > %SBD%
> > > > > which differs from the command line
> > > > > echo %SBD%
> > > > > T:\cs
> > > >
> > > > Try to use in make file
> > > > echo $(SBD)
> > > > instead of
> > > > echo %SBD%
> > > >
> > > > Alex
> > > >
> > > >
> > >
> > >
> >
> >
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.24110 seconds