bug-make
[Top][All Lists]
Advanced

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

[bug #31430] Add support for the BSD "shell assignment" operator (!=)


From: Paul D. Smith
Subject: [bug #31430] Add support for the BSD "shell assignment" operator (!=)
Date: Thu, 31 Mar 2011 19:55:40 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:2.0) Gecko/20100101 Firefox/4.0

Follow-up Comment #5, bug #31430 (project make):

Those lines were never ignored (GNU make never ignores malformed lines). 
Instead, because the prefix "!" was not recognized, GNU make assumed that it
was part of the variable name.  If you look at the output of GNU make -p with
your sample makefile and search for "OS" you'll see a variable defined named
"OS      !".  That's why it appears that the line has no effect because you
never try to access that variable.

The change in GNU make 3.82 was that variable names containing whitespace were
disallowed; this IS documented in the NEWS file as a
backward-incompatibility:


* WARNING: Backward-incompatibility!
  As a result of parser enhancements, three backward-compatibility issues
  exist: first, a prerequisite containing an "=" cannot be escaped with a
  backslash any longer.  You must create a variable containing an "=" and
  use that variable in the prerequisite.  Second, variable names can no
  longer contain whitespace, unless you put the whitespace in a variable and
  use the variable.  Third, in previous versions of make it was sometimes
  not flagged as an error for explicit and pattern targets to appear in the
  same rule.  Now this is always reported as an error.


You can work around this by removing the whitespace in your makefile; changing
it to use this:


OS:=       $(shell uname -s)
OS!=       uname -s


Then it will work again.  Not that I'm necessarily recommending this as a best
practice or anything...

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?31430>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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