HP-UX Reference (11i v3 07/02) - 1 User Commands A-M (vol 1)
m
make(1) make(1)
-S Terminate if an error occurs while executing the commands to bring a target up-to-date.
This is the default and the opposite of
-k. If both -k and -S are specified, the last one
given is used. This enables overriding the presence of the
k flag in the MAKEFLAGS
environment variable.
-t Touch the target files (causing them to be up-to-date) rather than issue the usual com-
mands.
-u Unconditionally
make the target, ignoring all timestamps.
-w Suppress warning messages. Fatal messages will not be affected.
[macro_name=value]
Zero or more command line macro definitions can be specified. See the Macros subsection.
[names] Zero or more target names that appear in the makefile. Each target so specified is updated
by
make. If no names are specified,
make updates the first target in the makefile that is
not an inference rule.
Parallel Make
If
make is invoked with the -P option, it tries to build more than one target at a time, in parallel. (This is
done by using the standard UNIX system process mechanism which enables multiple processes to run
simultaneously.) For the makefile shown in the example in the previous subsection, it would create
processes to build a.o and b.o in parallel. After these processes were complete, it would build pgm
.
The number of targets
make will try to build in parallel is determined by the value of the environment
variable PARALLEL .If-P is invoked, but PARALLEL is not set, then make will try to build no more
than two targets in parallel.
You can use the
.MUTEX directive to serialize the updating of some specified targets. This is useful when
two or more targets modify a common output file, such as when inserting modules into an archive or when
creating an intermediate file with the same name, as is done by lex and yacc. If the makefile in the pre-
vious subsection contained a
.MUTEX directive of the form
.MUTEX: a.o b.o
it would prevent make from building a.o and b.o in parallel.
Environment
All variables defined in the environment (see environ(5)) are read by make and are treated and processed
as macro definitions, with the exception of the
SHELL environment variable which is always ignored. The
value of the SHELL environment variable will not be used as a macro and will not be modified by defining
the SHELL macro in a makefile or on the command line. Variables with no definition or empty string
definitions are included by make.
There are four possible sources of macro definitions which are read in the following order: internal
(default), current environment, the makefile(s), and command line. Because of this order of processing,
macro assignments in a makefile override environment variables. The -e option allows the environment to
override the macro assignments in a makefile. Command-line macro definitions always override any other
definitions.
The MAKEFLAGS environment variable is processed by make on the assumption that it contains any legal
input option (except -f, -p, and -d) defined for the command line. The MAKEFLAGS variable can also be
specified in the makefile.
(UNIX Standard only, see standards(5). MAKEFLAGS in the makefile replaces the MAKEFLAGS environ-
ment variable. Command line options have precedence over MAKEFLAGS environment variable.)
If MAKEFLAGS is not defined in either of these places, make constructs the variable for itself, puts the
options specified on the command line and any default options into it, and passes it on to invocations of
commands. Thus, MAKEFLAGS always contains the current input options. This proves very useful for
doing recursive make commands. Even when the -n option is specified, command lines containing the
string $(MAKE) or ${MAKE} are executed; hence, one can perform a make -n recursively on an entire
software system to see what would have been executed. This is possible because the -n is put into
MAKEFLAGS and passed to the recursive invocations of $(MAKE) or ${MAKE}. This is one way of debug-
ging all of the makefiles for a software project without actually executing any of the commands.
Each of the commands in the rules is given to a shell to be executed. The shell used is the shell command
interpreter (see sh(1)), or the one specified in the makefile by the SHELL macro. To ensure the same shell
638 Hewlett-Packard Company − 4 − HP-UX 11i Version 3: February 2007