As I work on various people's build systems, one pet peeve of mine is that they
let too much of the environment leak into their command scripts.  If a user
finds that setting a variable makes his build work in some specific way, often
that information is not communicated to all the engineers, and they find strange
discrepancies in the way their builds behave.

I always try to create a more strict configuration hygiene by cleansing the
environment using "env -i" at the beginning of each command.  But this is
tedious for me, hard to read for others, and prone to me forgetting to do it.  I
would like to make it the default behavior.

For example, I commonly write rules something like this:

GCC := /path/to/specific/gcc
SOMETHING_ELSE := variable_specific_value
TAILORED_ENVIRONMENT := GCC=$(GCC) SOMETHING_ELSE=$(SOMETHING_ELSE)

compile:
        env -i $(TAILORED_ENVIRONMENT) /path/to/some_command_here

I'm not tied to this syntax, or to using env.  I just want to have total control
over the environment for every command in my makefile.  Any suggestions?

Dave




_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to