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: Sat, 03 Mar 2012 11:33:32 -0500

On Sat, 2012-03-03 at 07:32 -0800, Mark Galeck (CW) wrote:
> MACRO = $(info ->$(1)<-)
> $(eval $(call MACRO,\
> foobar))
> 
> causes a blank to be added before foobar!  So "inserting a backslash
> followed by a newline" changed the behaviour of the makefile.

I agree that this behavior (backslash/newline is replaced by a single
space) is annoying; if I were creating makefile syntax I would not have
done it this way.  However make is in that class of utilities that were
invented in the very early days, before many of the syntax "best
practices" we now take for granted had been discovered.  Unfortunately
this is mandated by the POSIX spec and it's been true of every version
of GNU make (and other versions of make).  Just yesterday I saw a
makefile that contained this:

        SOURCES = foo.c\
        bar.c\
        biz.c\
        baz.c

so changing this would absolutely break many real makefiles.

-- 
-------------------------------------------------------------------------------
 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




reply via email to

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