]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* doc/autoconf.texi (Limitations of Make): Escaped newlines in
authorAlexandre Duret-Lutz <adl@gnu.org>
Thu, 25 Jul 2002 21:00:45 +0000 (21:00 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Thu, 25 Jul 2002 21:00:45 +0000 (21:00 +0000)
comments do not always work. Never trust the exit status of
`make -k'.

ChangeLog
doc/autoconf.texi

index 6d03b2397b1af444a27d4824bf04d163f91f5b46..b97679cfbed873d478fb66665dc4473ad4e9c2a8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,16 @@
+2002-07-25  Alexandre Duret-Lutz  <duret_g@epita.fr>
+
+       * doc/autoconf.texi (Limitations of Make): Escaped newlines in
+       comments do not always work. Never trust the exit status of
+       `make -k'.
+
 2002-07-23  Paul Eggert  <eggert@twinsun.com>
 
        * lib/m4sugar/m4sh.m4 (_AS_PATH_SEPARATOR_PREPARE):
        Use PATH="/nonexistent;.", not PATH=".;.", as FreeBSD ksh2002
        apparently treats PATH="nonexistent" as if it contained ".".
        Bug reported by Stefan `Sec' Zehl.
-       
+
 2002-07-22  Alexandre Duret-Lutz  <duret_g@epita.fr>
 
        * doc/autoconf.texi (Limitations of Make): Mention the special
index 23bf77064191f1025e8d58f727e6f8a4c00cca3d..d99f8c8a8d22bdb2ea33e6d2b85b2464ec17b1d8 100644 (file)
@@ -10276,6 +10276,44 @@ test:
 shows @code{FOO} equal to @code{one BAR = two}.  Other Makes sensibly
 let a backslash continue only to the immediately following line.
 
+@item Escaped newline in comments
+
+According to @sc{posix}, Makefile comments start with @code{#} and
+continue until an unescaped newline is reached.
+
+@example
+% @kbd{cat Makefile}
+# A = foo \
+      bar \
+      baz
+
+all:
+        @@echo ok
+% @kbd{make}   # GNU make
+ok
+@end example
+
+@noindent
+However in Real World this is not always the case.  Some implementations
+discards anything from @code{#} up to the end of line, ignoring any
+trailing backslash.
+
+@example
+% @kbd{pmake}  # BSD make
+"Makefile", line 3: Need an operator
+Fatal errors encountered -- cannot continue
+@end example
+
+@noindent
+Therefore, if you want to comment a multi-line definition, prefix each
+line with @code{#}, not only the first.
+
+@example
+# A = foo \
+#     bar \
+#     baz
+@end example
+
 @item @code{make macro=value} and sub-@command{make}s.
 
 A command-line variable definition such as @code{foo=bar} overrides any
@@ -10421,6 +10459,27 @@ echo World
 World
 @end example
 
+@item @code{make -k}
+@cindex @code{make -k}
+
+Do not rely on the exit status of @code{make -k}.  Some implementations
+reflect whether they encountered an error in their exit status; other
+implementations always succeed.
+
+@example
+% @kbd{cat Makefile}
+all:
+        false
+% @kbd{make -k; echo exit status: $?}    # GNU make
+false
+make: *** [all] Error 1
+exit status: 2
+% @kbd{pmake -k; echo exit status: $?}   # BSD make
+false
+*** Error code 1 (continuing)
+exit status: 0
+@end example
+
 @item @code{VPATH}
 @cindex @code{VPATH}