bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GNU make strips leading whitespace from variables defined from the comma


From: Stefano Lattarini
Subject: GNU make strips leading whitespace from variables defined from the command line
Date: Sat, 04 Aug 2012 22:38:31 +0200

Make version:

  GNU Make 3.82
  Built for i686-pc-linux-gnu
  Copyright (C) 2010  Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.

How to reproduce:

  $ make V=' x' -f - <<<'all:; test "$(V)" = " x"'
  test "x" = " x"
  make: *** [all] Error 1
  $ echo $?
  1

The issue is not present for values inherited from the environment:

  $ V=' x' make -f - <<<'all:; test "$(V)" = " x"'
  test " x" = " x"
  $ echo $?
  0
  $ V=' x' make -e -f - <<<'all:; test "$(V)" = " x"'
  test " x" = " x"
  $ echo $?
  0

Regards,
  Stefano



reply via email to

[Prev in Thread] Current Thread [Next in Thread]