Managing file interactions with make

The make command

The make(1) command takes macro definitions, options, description file names, and target file names as arguments in the form:

$ make [ options ] [ macro definitions and targets ]

The following summary of command operations explains how these arguments are interpreted.

First, all macro definition arguments (arguments with embedded = symbols) are analyzed and the assignments made. Command line macros override corresponding definitions found in the description files. Next, the option arguments are examined. The permissible options are as follows:

Ignore error codes returned by invoked commands. This mode is entered if the fake target name .IGNORE appears in the description file.

Silent mode. Do not print command lines before executing. This mode is also entered if the fake target name .SILENT appears in the description file.

Do not use the built-in rules.

No execute mode. Print commands, but do not execute them. Even lines beginning with an ``@'' sign are printed.

Touch the target files (causing them to be up to date) rather than issue the usual commands.

Question. The make command returns a zero or nonzero status code depending on whether the target file is or is not up to date.

Print out the complete set of macro definitions and target descriptions.

Abandon work on the current entry if something goes wrong, but continue on other branches that do not depend on the current entry.

Environment variables override assignments within makefiles.

Description file name. The next argument is assumed to be the name of a description file. A file name of - denotes the standard input. If there are no -f arguments, the file named makefile, Makefile, s.makefile, or s.Makefile in the current directory is read. The contents of the description files override the built-in rules if they are present.

Update, in parallel, more than one target at a time. The number of targets updated concurrently is determined by the environment variable PARALLEL and the presence of .MUTEX directives in makefiles.
The following two fake target names are evaluated in the same manner as flags:

If a file must be made but there are no explicit commands or relevant built-in rules, the commands associated with the name .DEFAULT are used if it exists.

Dependents on this target are not removed when quit or interrupt is pressed.

Finally, the remaining arguments are assumed to be the names of targets to be made and the arguments are done in left-to-right order. If there are no such arguments, the first name in the description file that does not begin with the symbol . is made.

Next topic: Environment variables
Previous topic: Dynamic dependency parameters

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004