From: Alexandre Duret-Lutz Date: Thu, 25 Jul 2002 21:00:45 +0000 (+0000) Subject: * doc/autoconf.texi (Limitations of Make): Escaped newlines in X-Git-Tag: AUTOCONF-2.53c~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e5dcc69a98b34cd57b2456d80cce2fdd0db20c4;p=thirdparty%2Fautoconf.git * doc/autoconf.texi (Limitations of Make): Escaped newlines in comments do not always work. Never trust the exit status of `make -k'. --- diff --git a/ChangeLog b/ChangeLog index 6d03b2397..b97679cfb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,16 @@ +2002-07-25 Alexandre Duret-Lutz + + * 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 * 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 * doc/autoconf.texi (Limitations of Make): Mention the special diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 23bf77064..d99f8c8a8 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -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}