help-make
[Top][All Lists]
Advanced

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

Re: backslash does not simply continue line?


From: Paul Smith
Subject: Re: backslash does not simply continue line?
Date: Tue, 6 Mar 2012 16:15:24 -0500

On Tue, 2012-03-06 at 15:56 -0500, David Boyce wrote:
> On Tue, Mar 6, 2012 at 3:44 PM, Paul Smith <address@hidden> wrote:
> > The sucky thing about this behavior is that it's simple to add a space
> > when you want one, but it's very hard to REMOVE one that's added for you
> > automatically.  But, it is what it is and can't be changed now.
> 
> I know you're against new functions in general, but the obvious
> solution is a function that squeezes out spaces, $(rmspace) or
> whatever.

You can already do this, with a little setup:

        E :=
        S := $E $E
        
        COMPRESSED = $(subst $S,,$(WORDS))

The problem is that this is not really useful.  Very often you don't
want to remove ALL space.  You just want to be able to split a long line
without introducing an extraneous space (but still preserving the
non-extraneous ones).

Back in the day when variable values were simple, it was no big deal to
only split a line where whitespace was not important because variables
contained lists of words.  But now with complex functions written as
macros, injudicious whitespace insertion can break your makefile.





reply via email to

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