Tools: MPW
Advanced Search
Apple Developer Connection
Member Login Log In | Not a Member? Support

MPW Command Reference


Make

Tool

SYNTAX

Make target1 [target2]… [-d name[=value]] [-e] [-f makeFile]
[-i includeDir] [-mf | -nomf] [-p] [-r] [-s] [-t] [-u] [-v] [-w] [-y]

DESCRIPTION

The Make tool generates commands to build or rebuild the specified targets, according to the dependencies in the program's makefile. Targets are commonly files, but they can also be artificial names or variables. Commands are automatically generated to build target files that do not exist. For target files that already exist, Make determines which components need to be rebuilt by looking at the dependencies described in the makefile. Commands are generated to rebuild components that depend on files that are newer than the target.

Aside from its default behavior, Make also allows you to

rebuild everything in the target, regardless of the modification date of dependencies (-e)

generate a dependency graph (-s)

find the roots (top-level targets) of the dependency graph (-r)

bring files up to date by "touching" the modification date (-t)

INPUT

One or more targets. You can also specify a makefile by using -f. Otherwise Make uses the MakeFile file located in the current directory.

OUTPUT

Standard output. Make generates MPW Shell commands to build or rebuild the files of the target.

STATUS

Make can return the following status codes:

0

no errors

1

parameter or option error

2

execution error

PARAMETERS

target1 [target2]…

Specifies one or more targets. Targets are commonly files but can be artificial names or variables.

If you do not specify any targets, Make generates commands to build the target on the left side of the first dependency rule in the makefile.

OPTIONS

-d name[=value]

Defines the variable name as having the given value value. Variables defined from the command line take precedence over definitions of the same variable in the makefile. Thus definitions in the makefiles act as defaults that you can override from the command line.

-e

Generates commands to rebuild all components of the specified targets, regardless of whether they are out of date. Normally Make rebuilds only components that depend on files that are older or newer than the target.

Note
This option does not necessarily rebuild all targets in the makefile if there is more than one top-level target, or root. •

-f makeFile

Reads dependency information from the specified makefile. If you specify more than one -f option, Make treats all dependency information as if it were in a single file.

If you do not specify any makefiles, Make uses the MakeFile file in the current directory.

-i includeDir

Specifies an additional directory to search for included files. Multiple -i options may be specified. The default is to only search the default directory.

-mf | -nomf

Enables or suppresses the use of Process Manager temporary memory.

Note that the Make command's use of Process Manager temporary memory excludes other applications from using it, even the Finder. If temporary memory is unavailable, this option has no effect.

WARNING
If Make aborts abnormally, that is, there is a crash or a nonmaskable interrupt (NMI), much of the Process Manager temporary memory might be left permanently allocated, thus potentially crippling launches and Finder copy operations. The only way to recover from this situation is to restart the computer. •

-p

Writes progress information to diagnostic output. Normally Make runs silently unless errors are detected.

-r

Generates a list of roots instead of generating the commands needed to build the target files. Make lists all roots in a dependency graph.

-s

Shows the structure of target dependencies. Instead of generating the commands needed to build the target files, Make writes a dependency graph, using indentation to indicate levels in the dependency tree. Any circular dependencies are noted.

This option is useful for debugging or verifying complicated makefiles.

-t

Brings the target files up to date by "touching" their modification dates. Instead of actually building the target files, this option makes a set of files appear up to date by setting their modification dates to the current date. This is useful, for instance, when you have made changes only to comments.

This option makes minor adjustments to satisfy the dependency relationships. Files are touched only if required and are given the date of their newest dependency to minimize any repercussions from the date adjustments. This minimal adjustment of dates is especially useful if the touched file is also a prerequisite for other programs.

-u

Writes a list of unreachable targets to diagnostic output (for debugging). Unreachable targets are any mentioned in the makefile that do not depend on the specified targets.

-v

Provides extensive diagnostic output. This option tells you what Make is doing and why, including which targets do not exist, whether they need to be rebuilt, and why they need to be rebuilt. It also indicates targets in the makefile that were not reached in the build.

-w

Suppresses warning messages that are issued for things such as files with dates in the future and circular dependency relationships.

-y

Writes a limited form of the output from -v to diagnostic output by withholding messages about up-to-date targets.

EXAMPLES

The following command line generates commands to build the Count.a target file and writes progress information to diagnostic output. The makefile for Count.a, named MakeFile, can be found in the AExamples folder.

Make Count.a -p -f MakeFile

The following example demonstrates the use of the predefined target $OutOfDate which is always out of date and needs to be rebuilt. The dependency rule in the first line makes myTest dependent on {ForceRebuild}, which is defined in the Make command line as $OutOfDate.

myTest ƒ {ForceRebuild}
Make -d ForceRebuild=$OutOfDate

Assuming that myTest is dependent on an out-of-date file, Make generates commands to rebuild myTest.

SEE ALSO

BuildMenu

CreateMake

Makefiles contained in the Examples folders

 
 


Last Updated July 2000