summaryrefslogtreecommitdiff
path: root/doc/make.texi
diff options
context:
space:
mode:
Diffstat (limited to 'doc/make.texi')
-rw-r--r--doc/make.texi11
1 files changed, 6 insertions, 5 deletions
diff --git a/doc/make.texi b/doc/make.texi
index 8fbdb61..21e32de 100644
--- a/doc/make.texi
+++ b/doc/make.texi
@@ -1528,7 +1528,7 @@ A rule is always expanded the same way, regardless of the form:
@example
@var{immediate} : @var{immediate} ; @var{deferred}
- @var{deferred}
+ @var{deferred}
@end example
That is, the target and prerequisite sections are expanded immediately,
@@ -7516,7 +7516,7 @@ exist.
The syntax of the @code{file} function is:
@example
-$(file @var{op} @var{filename},@var{text})
+$(file @var{op} @var{filename}[,@var{text}])
@end example
The operator @var{op} can be either @code{>} which indicates overwrite
@@ -7528,8 +7528,9 @@ When the @code{file} function is expanded all its arguments are
expanded first, then the file indicated by @var{filename} will be
opened in the mode described by @var{op}. Finally @var{text} will be
written to the file. If @var{text} does not already end in a newline,
-a final newline will be written. The result of evaluating the
-@code{file} function is always the empty string.
+even if empty, a final newline will be written. If the @var{text}
+argument is not given, nothing will be written. The result of
+evaluating the @code{file} function is always the empty string.
It is a fatal error if the file cannot be opened for writing, or if
the write operation fails.
@@ -7556,7 +7557,7 @@ input file, you might write your recipe like this:
@example
@group
program: $(OBJECTS)
- $(file >$@@.in,) $(foreach O,$^,$(file >>$@@.in,$O))
+ $(file >$@@.in) $(foreach O,$^,$(file >>$@@.in,$O))
$(CMD) $(CMDFLAGS) @@$@@.in
@@rm $@@.in
@end group