manpagez: man pages & more
info autoconf
Home | html | info | man

File: autoconf.info,  Node: Trailing whitespace in Make Macros,  Next: Command-line Macros and whitespace,  Prev: Comments in Make Macros,  Up: Portable Make

12.14 Trailing whitespace in Make Macros
========================================

GNU ‘make’ 3.80 mistreats trailing whitespace in macro substitutions and
appends another spurious suffix:

     empty =
     foo = bar $(empty)
     print: ; @echo $(foo:=.test)

prints ‘bar.test .test’.

   BSD and Solaris ‘make’ implementations do not honor trailing
whitespace in macro definitions as Posix requires:

     foo = bar # Note the space after "bar".
     print: ; @echo $(foo)t

prints ‘bart’ instead of ‘bar t’.  To work around this, you can use a
helper macro as in the previous example.

© manpagez.com 2000-2025
Individual documents may contain additional copyright information.