Environment variables are read and added to the
macro definitions each time make executes.
is a prime consideration in doing this properly.
The following describes make's interaction with
is maintained by make.
The macro is defined as the collection of
all input flag arguments into a string (without minus signs).
The macro is exported and
thus accessible to recursive invocations of make.
Command line flags and assignments in the makefile
Thus, to describe how the environment
interacts with make,
macro (environment variable) must be considered.
When executed, make assigns macro definitions in the following
be clearer to list the precedence of assignments.
Thus, in order from least binding to most binding,
the precedence of assignments is as follows:
If it is not present or null, the internal make
is set to the null string.
Otherwise, each letter in
is assumed to
be an input flag argument and is processed as such.
(The only exceptions are the -f, -p, and -r
Read the internal list of macro definitions.
Read the environment.
The environment variables are treated as macro
definitions and marked as exported (in
the shell sense).
Read the makefile(s).
The assignments in the makefile(s)
override the environment.
This order is chosen
so that when a makefile is read and executed,
you know what to expect.
That is, you
get what is seen unless the -e flag is used.
The -e is the input flag argument, which
tells make to have the environment override
the makefile assignments.
Thus, if make -e
is entered, the variables in the environment override
the definitions in the makefile.
overrides the environment if assigned.
This is useful for further invocations of make
from the current makefile.
The -e flag has the effect of rearranging the order to:
This order is general enough to allow
a programmer to define a makefile or set of makefiles
whose parameters are dynamically definable.
Suggestions and warnings
The make command
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004