version 1.5, 1994/02/10 18:25:01 |
version 1.6, 1994/03/05 00:34:56 |
Line 75 and makefiles, please refer to |
|
Line 75 and makefiles, please refer to |
|
The options are as follows: |
The options are as follows: |
.Bl -tag -width Ds |
.Bl -tag -width Ds |
.It Fl D Ar variable |
.It Fl D Ar variable |
Define |
Define Ar variable |
.Ar variable |
|
to be 1, in the global context. |
to be 1, in the global context. |
.It Fl d Ar flags |
.It Fl d Ar flags |
Turn on debugging, and specify which portions of |
Turn on debugging, and specify which portions of |
|
|
.Ar value . |
.Ar value . |
.El |
.El |
.Pp |
.Pp |
There are six different types of lines in a makefile: file dependency |
There are seven different types of lines in a makefile: file dependency |
specifications, shell commands, variable assignments, include statements, |
specifications, shell commands, variable assignments, include statements, |
conditional directives, and comments. |
conditional directives, for loops, and comments. |
.Pp |
.Pp |
In general, lines may be continued from one line to the next by ending |
In general, lines may be continued from one line to the next by ending |
them with a backslash |
them with a backslash |
|
|
.At V |
.At V |
style variable substitution. |
style variable substitution. |
It must be the last modifier specified. |
It must be the last modifier specified. |
.Ar Old_string |
If |
is anchored at the end of each word, so only suffixes or entire |
.Ar old_string |
words may be replaced. |
or |
.El |
.Ar new_string |
.Sh INCLUDE STATEMENTS AND CONDITIONALS |
do not contain the pattern matching character |
Makefile inclusion and conditional structures reminiscent of the C |
.Ar % |
programming language are provided in |
then it is assumed that they are |
|
anchored at the end of each word, so only suffixes or entire |
|
words may be replaced. Otherwise |
|
.Ar % |
|
is the substring of |
|
.Ar old_string |
|
to be replaced in |
|
.Ar new_string |
|
.El |
|
.Sh INCLUDE STATEMENTS, CONDITIONALS AND FOR LOOPS |
|
Makefile inclusion, conditional structures and for loops reminiscent |
|
of the C programming language are provided in |
.Nm make . |
.Nm make . |
All such structures are identified by a line beginning with a single |
All such structures are identified by a line beginning with a single |
dot |
dot |
Line 655 has been defined. |
|
Line 665 has been defined. |
|
.El |
.El |
.Pp |
.Pp |
.Ar Expression |
.Ar Expression |
may also be an arithmetic or string comparison, with the left-hand side |
may also be an arithmetic or string comparison. Variable expansion is |
being a variable expansion. |
performed on both sides of the comparison, after which the integral |
The standard C relational operators are all supported, and the usual |
values are compared. A value is interpreted as hexadecimal if it is |
number/base conversion is performed. |
preceded by 0x, otherwise it is decimal; octal numbers are not supported. |
Note, octal numbers are not supported. |
The standard C relational operators are all supported. If after |
If the righthand value of a |
variable expansion, either the left or right hand side of a |
.Ql Ic == |
.Ql Ic == |
or |
or |
.Ql Ic "!=" |
.Ql Ic "!=" |
operator begins with a |
operator is not an integral value, then |
quotation mark |
string comparison is performed between the expanded |
.Pq Ql \*q |
variables. |
a string comparison is done between the expanded |
|
variable and the text between the quotation marks. |
|
If no relational operator is given, it is assumed that the expanded |
If no relational operator is given, it is assumed that the expanded |
variable is being compared against 0. |
variable is being compared against 0. |
.Pp |
.Pp |
Line 697 In both cases this continues until a |
|
Line 705 In both cases this continues until a |
|
or |
or |
.Ql Ic .endif |
.Ql Ic .endif |
is found. |
is found. |
|
.Pp |
|
For loops are typically used to apply a set of rules to a list of files. |
|
The syntax of a for loop is: |
|
.Bl -tag -width Ds |
|
.It Xo |
|
.Ic \&.for |
|
.Ar variable |
|
.Ic in |
|
.Ar expression |
|
.Xc |
|
.It Xo |
|
<make-rules> |
|
.Xc |
|
.It Xo |
|
.Ic \&.endfor |
|
.Xc |
|
.El |
|
After the for |
|
.Ic expression |
|
is evaluated, it is split into words. The |
|
iteration |
|
.Ic variable |
|
is successively set to each word, and substituted in the |
|
.Ic make-rules |
|
inside the body of the for loop. |
.Sh COMMENTS |
.Sh COMMENTS |
Comments begin with a hash |
Comments begin with a hash |
.Pq Ql \&# |
.Pq Ql \&# |