make(1)

make(1)

 

given is used. This enables overriding the presence of the k ¯ag in the MAKEFLAGS

 

environment variable.

-t

Touch the target ®les (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 de®nitions can be speci®ed. See the Macros section.

[names]

Zero or more target names that appear in the make®le. Each target so speci®ed is updated

 

by make. If no names are speci®ed, make updates the ®rst target in the make®le 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 make®le shown in the example in the previous section, 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 speci®ed targets. This is useful when two or more targets modify a common output ®le, such as when inserting modules into an archive or when creating an intermediate ®le with the same name, as is done by lex and yacc. If the make®le in the previous section 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 de®ned in the environment (see environ(5)) are read by make and are treated and processed as macro de®nitions, 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 modi®ed by de®ning the SHELL macro in a make®le or on the command line. Variables with no de®nition or empty string de®nitions are included by make.

There are four possible sources of macro de®nitions which are read in the following order: internal (default), current environment, the make®le(s), and command line. Because of this order of processing, macro assignments in a make®le override environment variables. The -eoption allows the environment to override the macro assignments in a make®le. Command-line macro de®nitions always override any other de®nitions.

The MAKEFLAGS environment variable is processed by make on the assumption that it contains any legal input option (except -f, -p, and -d) de®ned for the command line. The MAKEFLAGS variable can also be speci®ed in the make®le.

(XPG4 only. MAKEFLAGS in the make®le replaces the MAKEFLAGS environment variable. Command line options have precedence over MAKEFLAGS environment variable.)

If MAKEFLAGS is not de®ned in either of these places, make constructs the variable for itself, puts the options speci®ed 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 recursive makes. Even when the -noption is speci®ed, command lines containing the string $(MAKE) or ${MAKE} are executed; hence, one can perform a make -nrecursively on an entire software system to see what would have been executed. This is possible because the -nis put into MAKEFLAGS and passed to the recursive invocations of $(MAKE) or ${MAKE}. This is one way of debugging all of the make®les 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 speci®ed in the make®le by the SHELL macro. To ensure the same shell is used each time a make®le is executed, the line:

HP-UX Release 11i: December 2000

− 4 −

Section 1511

m