[Top][All Lists]

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

Re: Naming: a rose by any other ...

From: Paul Smith
Subject: Re: Naming: a rose by any other ...
Date: Sat, 15 Sep 2007 18:42:44 -0400

On Fri, 2007-09-14 at 19:03 +0200, Ramón García wrote:
> My favorite behaviour would be that the first line after the rule says
> how much spaces (or tabs or whatever) are used for indenting, and any
> following lines with that indentation or more would belong to the
> recipe. In this way, a user who just types spaces instead of tabs
> would see make just working without obscure settings. (This syntax is
> inspired in Haskell).

It's not that easy: because make's syntax is so free-form today there
can be all sorts of confusion, as Boris points out.  Remember that
command scripts last until the next non-empty line: comments, blank
lines, etc. do not end them.  For another example, consider this:

        foo: bar

        # set some variables indented with spaces
          FOO = foo
          BAR = bar
        FOFOO = foo

In the current syntax none of the variable settings begin with TAB, so
all of them are considered make variables.  In your version the first
two variables would have to be considered part of the command script, I

> Although this behaviour cannot be the default for backward
> compatibility. But this is issue can be solved. When make detects that
> the user is using spaces instead of tabs, make would warn the user and
> advice to use the correct flag.

No, I really don't like this kind of magical intuition on the part of
tools like make.  As Boris mentions, make is a low-level tool not an
expert system.  In my experience the intuition is wrong often enough
that it's not reliable, and once they get something wrong it can be
annoying at best to convince them otherwise.

I much prefer a well-defined behavior, or an explicit setting to change
the behavior if that's what the user wants.

 Paul D. Smith <address@hidden>          Find some GNU make tips at:            
 "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]