help-make
[Top][All Lists]
Advanced

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

Re: make failing, tabs are fine, missing separator


From: Paul Smith
Subject: Re: make failing, tabs are fine, missing separator
Date: Thu, 10 Jan 2008 08:02:09 -0500

Thanks for taking point on this Philip.  Just a brief comment or two:

On Wed, 2008-01-09 at 14:40 -0700, Philip Guenther wrote:
> Well, the problem should be obvious now: you've been editing the
> makefile with silly editors that think that lines end with CRLF or
> just CR instead of just LF.  The result is all those stray CRs that
> sometimes _look_ like they ended a line but that don't actually do so.
> IIRC, as far as GNU make is concerned, CR is just whitespace like a
> normal space.

This looks like it's been edited on a Mac.  On Linux, newline is LF.  On
Windows, it's CRLF.  On Mac, it's just CR (no LF).

GNU make has had a Windows file compatibility mode for at least one
release now, where it recognizes both CRLF and LF as newlines to help
with the common problem of people editing makefiles on Windows machines.

However, it does require the LF.  You can't just use CR with no LF, as
you discovered.

> You left a blank line between the target and the rules.  That acts as
> a separator,

This is actually not true.  You can put as many blank lines as you like
between the target and the recipe, and between the rules inside a single
recipe.  Blank lines are completely ignored by make.  Note that lines
with nothing but comments and/or space characters are also considered
blank lines.  The only things that can end a rule are another rule, or a
variable definition.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.us
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

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