[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Extraneous text after `else' directive
From: |
Paul Smith |
Subject: |
Re: Extraneous text after `else' directive |
Date: |
Fri, 11 Jun 2010 23:29:56 -0400 |
On Fri, 2010-06-11 at 19:14 -0700, Michael Morrell wrote:
> If, however, I "break" it by deleting the space after "ifeq":
> --------------------------
> ifdef FOO
> XYZ = 1
> else ifeq("$(BAR)", "abc")
> XYZ = 2
> else
> XYZ = 3
> endif
> % FOO=a make
> Makefile:3: Extraneous text after `else' directive
> 1
> 1) Is it just me, or is the manual not that clear that a space after
> "ifeq" is required?
Well, it doesn't say so explicitly however all the examples and the
section that defines the syntax ("Syntax of Conditionals") use
whitespace.
> 2) Is there a way to have this case cause make to fail (return an exit
> status of 1)? The note about "Extraneous text" is easy to miss in a
> large Makefile output file.
There is no way to do that currently (except changing the source of
course). However, maybe it's not a bad idea to make this a fatal syntax
error rather than a warning / informational note.
--
-------------------------------------------------------------------------------
Paul D. Smith <address@hidden> Find some GNU make tips at:
http://www.gnu.org http://make.mad-scientist.net
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist