help-make
[Top][All Lists]
Advanced

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

Re: Patch which allows make to use leading spaces rather than tabs


From: Alessandro Vesely
Subject: Re: Patch which allows make to use leading spaces rather than tabs
Date: Thu, 10 Mar 2005 10:29:45 +0100

"Paul D. Smith" wrote:
> 
> %% Dave Hylands <address@hidden> writes:
> 
>   dh> Since I've already dived in, I created a patch which allows make
>   dh> to accept leading spaces rather than tabs for the recipies (but
>   dh> still preserves leading spaces for ifeq and friends).
> 
> Unfortunately there are ambiguities to the make language which are
> widely used, and where patches like this cause very different behavior
> (to the point of breaking makefiles).  For example:
> 
> foo: bar
> 
>     THIS = that
>      FOO = bar
>   BIZBAZ = boz
> 
> will be interpreted quite differently with a patch like this.

Other make utilities that allow both tab or spacesare more strict w.r.t.
white lines: one cannot put empty lines between command rules and must
terminate command rules with an empty white line. A portable makefile
can be rebuilt without ambiguities after it has been corrupted by an
editor that converts whitespace.

Makefiles generated by autoconf are not portable in that sense. Hand
written makefiles often are.

> set a different character (other than TAB) to be used to introduce rules;

Alternatively, it may make sense to have a rule that rebuilds a portable
makefile. The rule must not be enabled by default, it should be a command
line option or written inside the makefile itself.




reply via email to

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