Полезная информация

UNIX in a Nutshell: System V Edition

UNIX in a Nutshell: System V EditionSearch this book
Previous: 19.1 Command-line SyntaxChapter 19
The make Utility
Next: 19.3 Macros

19.2 Description File Lines

Instructions in the description file are interpreted as single lines. If an instruction must span more than one input line, use a backslash (\) at the end of the line so that the next line is considered as a continuation. The description file may contain any of the following types of lines:

blank lines

Blank lines are ignored.

comment lines

A pound sign (#) can be used at the beginning of a line or anywhere in the middle. make ignores everything after the #.

dependency lines

Depending on one or more targets, certain commands that follow will be executed. Possible formats include:

targets : prerequisites
targets :: prerequisites

In the first form, subsequent commands are executed if the prerequisites are met. The second form is a variant that lets you specify the same targets on more than one dependency line. In both forms, if no prerequisites are supplied, then subsequent commands are always executed (whenever any of the targets are specified). No tab should precede any targets. (At the end of a dependency line, you can specify a command, preceded by a semicolon; however, commands are typically entered on their own lines, preceded by a tab.)

suffix rules

These specify that files ending with the first suffix can be prerequisites for files ending with the second suffix (assuming the root filenames are the same). Either of these formats can be used:


The second form means that the root filename depends on the filename with the corresponding suffix. Commands are grouped below the dependency line and are typed on lines that begin with a tab. If a command is preceded by a hyphen (-), make ignores any error returned. If a command is preceded by an at-sign (@), the command line won't echo on the display (unless make is called with -n).

macro definitions

These have the following form:

name = string

Blank space is optional around the =.

include statements

Similar to the C include directive, these have the form:

include file

Previous: 19.1 Command-line SyntaxUNIX in a Nutshell: System V EditionNext: 19.3 Macros
19.1 Command-line SyntaxBook Index19.3 Macros

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System