Open System Services Shell and Utilities Reference Manual (G06.25+, H06.03+)

make(1) OSS Shell and Utilities Reference Manual
4. Command lines
Note, however, that the -e option causes environment variables to override those dened in the
makele.
The SHELL macro is special. It is set by make to the pathname of the shell command inter-
preter (/bin/sh). However, if it is redened in the makele, or on the command line, then this
default setting is overridden. Note that this macro does not affect, and is not affected by, the
SHELL environment variable.
Shell Commands
Each target can have associated with it a series of shell commands, normally used to create the
target. Each of the commands in this script must be preceded by a tab character. While any tar-
get can appear on a dependency line, only one of these dependencies can be followed by a crea-
tion script, unless the :: operator is used.
If the rst one or two characters of the command line are @, -, +, the command is treated spe-
cially, as follows:
@ Prevents the command from being echoed before it is executed.
- Causes any nonzero exit status of the command line to be ignored.
+ Causes a command line to be executed, even though the -n, -q,or-t ags are
specied.
Variable Assignments
Variables in make are much like variables in the shell and, by tradition, consist of all uppercase
letters. The = operator assigns values to variables. Any previous variable is then overridden.
Any white space before the assigned value is removed; if the value is being appended, a single
space is inserted between the previous contents of the variable and the appended value.
Variables are expanded by surrounding the variable name with either {} (braces) or ()
(parentheses) and preceding it with a $ (dollar sign). If the variable name contains only a single
letter, the surrounding braces or parentheses are not required. This shorter form is not recom-
mended.
Variable substitution occurs at two distinct times, depending on where the variable is being used.
Variables in dependency lines are expanded as the line is read. Variables in shell commands are
expanded when the shell command is executed.
The four different classes of variables (in order of increasing precedence) are:
Environment variables
Variables dened as part of the make programs environment.
Global variables
Variables dened in the makele or in included makeles.
Command line variables
Variables dened as part of the command line.
Local variables
Variables that are dened specic to a certain target. The local variables are as fol-
lows:
$< Represents either the full name of a source that made a target out-of-
date (inference rule), or the full name of a target (.DEFAULT rule).
66 Hewlett-Packard Company 527188-003