axiom-developer
[Top][All Lists]
Advanced

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

Re: [Axiom-developer] ENV


From: root
Subject: Re: [Axiom-developer] ENV
Date: Wed, 22 Nov 2006 17:12:24 -0500

> There is this line in the Makefile for regression testing:
> 
>   regress:
>           ${ENV} ${MAKE} DAASE=$(axiom_targetdir) regression-tests
> 
> 
> Notice that there is no explicit mention of sh, but Make will call it
> because that is the way Make works.
> 
> In my case, I stepped into the build directory for input/ and typed
> make.  At that point ENV (which is exported by my login shell) has the
> value dictated by POSIX, but not overriden by toplevel Makefile.  So
> it expanded to /etc/bash.bashrc.
> 
> Notice that even if ENV has been overriden by the toplevel Makefile,
> that doing is still wrong (it is only a matter of time to trip over
> it) because the shell will see that the variable is defined and
> attempt to use its value as indicating a file to read and execute.

An excellent point. Except that none of the makefiles in the axiom
tree are designed to be executed "standalone". The critical variables
are not defined, e.g. SRC, INT, OBJ, MNT, etc. The fact that ENV has
a meaning in the shell is pure coincidence. 

Executing a makefile that is not designed to be executed is 
guaranteed to fail whether the variable is named ENV or TPD or
any other random name. 

This discussion seems so strange. Can any programmer claim that we
should never use 'if' as a variable name because it has another
meaning? Can you claim that whatever name you choose (e.g. SRC,
INT, BUILD, CVS_RSH, etc) will never be assigned a future meaning
and is therefore safe to use?

t





reply via email to

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