Environment setting for make

Giorgos Keramidas keramida at ceid.upatras.gr
Sat Sep 17 08:39:10 PDT 2005


On 2005-09-18 01:30, Joel Hatton <joel at auscert.org.au> wrote:
> > Joel Hatton <freebsd-questions at auscert.org.au> writes:
> >
> > > 	#               E.g. use `env MAKEOBJDIRPREFIX=/somewhere/obj make'
> > >
> > > However, and at this risk of exposing my inexperience and just plain old
> > > sounding foolish, how does this method of setting MAKEOBJDIRPREFIX differ
> > > from:
> > >
> > > 	setenv MAKEOBJDIRPREFIX /somewhere/obj
> >
> > It's effect is only seen by "make", instead of all subsequent
> > commands.  It also works in a Bourne shell where the Bourne equivalent
> > of the second method is:  MAKEOBJDIRPREFIXj=/somewhere/obj make
>
> Thanks, I think I understand.
>
> I'm a little confused about the Bourne shell, however. Do you mean that
> (1) 'MAKEOBJDIRPREFIX=/somewhere/obj make' is equivalent to (2) 'setenv
> MAKEOBJDIRPREFIX /somewhere/obj' or (3) 'env
> MAKEOBJDIRPREFIX=/somewhere/obj make'? Can (1) be substituted for (3)?
>
> From my trials, (1) and (2) aren't similar as MAKEOBJDIRPREFIX remains
> unset in the shell after make exits for (1). In csh (2) has the same effect
> as the Bourne 'export MAKEOBJDIRPREFIX=/somewhere/obj'

(1) sets the environment variable for the duration of the command only.
(2) works in csh and derivatives in a way similar to (3)
(3) sets MAKEOBJDIRPREFIX permanently in the environment of Bourne shells



More information about the freebsd-questions mailing list