]> git.ipfire.org Git - thirdparty/make.git/commitdiff
* doc/make.texi: [SV 35455] Add more uses for Empty Recipes.
authorPaul Smith <psmith@gnu.org>
Sun, 28 Feb 2016 17:35:15 +0000 (12:35 -0500)
committerPaul Smith <psmith@gnu.org>
Sun, 28 Feb 2016 17:35:15 +0000 (12:35 -0500)
doc/make.texi

index 86a1aebc3189b340e4d176ed97d1e77c296e8a57..e89217135c10c5bc0b169f5261a539ab6d3ad034 100644 (file)
@@ -4970,27 +4970,24 @@ beginning with a recipe prefix character to define an empty recipe,
 but this would be confusing because such a line looks empty.
 
 @findex .DEFAULT@r{, and empty recipes}
-You may be wondering why you would want to define a recipe that
-does nothing.  The only reason this is useful is to prevent a target
-from getting implicit recipes (from implicit rules or the
-@code{.DEFAULT} special target; @pxref{Implicit Rules} and
-@pxref{Last Resort, ,Defining Last-Resort Default Rules}).@refill
-
-@c !!! another reason is for canonical stamp files:
-@ignore
-@example
-foo: stamp-foo ;
-stamp-foo: foo.in
-        create foo frm foo.in
-        touch $@
-@end example
-@end ignore
-
-You may be inclined to define empty recipes for targets that are
-not actual files, but only exist so that their prerequisites can be
+You may be wondering why you would want to define a recipe that does
+nothing.  One reason this is useful is to prevent a target from
+getting implicit recipes (from implicit rules or the @code{.DEFAULT}
+special target; @pxref{Implicit Rules} and @pxref{Last Resort,
+,Defining Last-Resort Default Rules}).@refill
+
+Empty recipes can also be used to avoid errors for targets that will
+be created as a side-effect of another recipe: if the target does not
+exist the empty recipe ensures that @code{make} won't complain that it
+doesn't know how to build the target, and @code{make} will assume the
+target is out of date.
+
+You may be inclined to define empty recipes for targets that are not
+actual files, but only exist so that their prerequisites can be
 remade.  However, this is not the best way to do that, because the
-prerequisites may not be remade properly if the target file actually does exist.
-@xref{Phony Targets, ,Phony Targets}, for a better way to do this.
+prerequisites may not be remade properly if the target file actually
+does exist.  @xref{Phony Targets, ,Phony Targets}, for a better way to
+do this.
 
 @node Using Variables, Conditionals, Recipes, Top
 @chapter How to Use Variables