From: Ralf Wildenhues Date: Sun, 23 Jan 2011 10:24:02 +0000 (+0100) Subject: docs: new section about whitespace trimmmed from make command-lines. X-Git-Tag: v2.68b~115 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3b2543cbf5af1c0f5511a774438fecfb7705efd;p=thirdparty%2Fautoconf.git docs: new section about whitespace trimmmed from make command-lines. * doc/autoconf.texi (Command-line Macros and whitespace): New section, document trimming of whitespace from macros set on the command line and from the environment. Signed-off-by: Ralf Wildenhues --- diff --git a/ChangeLog b/ChangeLog index b58a4086..2fc5ab34 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-01-23 Ralf Wildenhues + + docs: new section about whitespace trimmmed from make command-lines. + * doc/autoconf.texi (Command-line Macros and whitespace): New + section, document trimming of whitespace from macros set on the + command line and from the environment. + 2011-01-22 Ralf Wildenhues docs: document how to use comment characters in rules. diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 8a92ffde..ae601a07 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -535,6 +535,7 @@ Portable Make Programming * Newlines in Make Rules:: Using literal newlines in rules * Comments in Make Macros:: Other problems with Make comments in macros * Trailing whitespace in Make Macros:: Macro substitution problems +* Command-line Macros and whitespace:: Whitespace trimming of values * obj/ and Make:: Don't name a subdirectory @file{obj} * make -k Status:: Exit status of @samp{make -k} * VPATH and Make:: @code{VPATH} woes @@ -19141,6 +19142,7 @@ itself. * Newlines in Make Rules:: Using literal newlines in rules * Comments in Make Macros:: Other problems with Make comments in macros * Trailing whitespace in Make Macros:: Macro substitution problems +* Command-line Macros and whitespace:: Whitespace trimming of values * obj/ and Make:: Don't name a subdirectory @file{obj} * make -k Status:: Exit status of @samp{make -k} * VPATH and Make:: @code{VPATH} woes @@ -19646,6 +19648,26 @@ print: ; @@echo $(foo:=.test) @noindent prints @samp{bar.test .test}. +@node Command-line Macros and whitespace +@section Command-line Macros and whitespace +@cindex whitespace in command-line macros +@cindex command-line, macros set on +@cindex environment, macros set from + +Some @command{make} implementations may strip trailing whitespace off +of macros set on the command line in addition to leading whitespace. +Further, some may strip leading whitespace off of macros set from +environment variables: + +@example +$ @kbd{echo 'print: ; @@echo "x$(foo)x$(bar)x"' | + foo=' f f ' make -f - bar=' b b '} +x f f xb b x # AIX, BSD, GNU make +xf f xb b x # HP-UX, IRIX, Tru64/OSF make +x f f xb bx # Solaris make +@end example + + @node obj/ and Make @section The @file{obj/} Subdirectory and Make @cindex @file{obj/}, subdirectory