automake
[Top][All Lists]
Advanced

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

Re: backslashes in variable definition


From: Volker Boerchers
Subject: Re: backslashes in variable definition
Date: Tue, 22 Jun 2004 12:35:06 +0200 (CEST)

Hi Andrew,

On Mon, 21 Jun 2004, Andrew Suffield wrote:
> On Mon, Jun 21, 2004 at 04:38:23PM +0200, Volker Boerchers wrote:
> > the _SOURCES values of our Makefile.am's are split into multiple lines
> > to improve readability like this
> > 
> >   libfoo_la_SOURCES = \
> >     foo.c \
> >     bar.c
> > 
> > However if one forgets a backslash the source files after that are
> > silently ignored by automake.
> > 
> >   libfoo_la_SOURCES = \
> >         foo.c                  # missing '\' 
> >         bar.c
> > 
> > These errors are hard to detect, at least for libraries since missing
> > dependencies are detected later.
> 
> You should see the error you get if you do this:
> 
> libfoo_la_SOURCES = \
> #        foo.c \
>         bar.c

hmm, perhaps my mail was capable of being misunderstood. The example
that was attached to my previous mail was

hello_SOURCES = \
              hello.c
              bar.c

The error appears not until link time, when the bar.o object is
missing (automake 1.5 and 1.7.6). Your example 

hello_SOURCES = \
#             hello.c \
              bar.c

is detected as erroneous by automake 1.5

  $ automake || echo error with automake
  Makefile.am:9: comment following trailing backslash
  error with automake
  $ automake --version | grep automake
  automake (GNU automake) 1.5

but not by automake 1.7.6:

  $ automake || echo error in automake
  $ automake --version | grep automake
  automake (GNU automake) 1.7.6

BTW there is another interesting case that I have mentioned in my
previous mail

hello_SOURCES = \
              hello.c \
              bar.c \

automake 1.5 detects that as long as there is a full line after the
last backslash:

  $ automake || echo error with automake
  Makefile.am:11: blank line following trailing backslash
  error with automake

automake 1.7.6 even detects it on the last line:

  $ automake || echo error in automake
  Makefile.am: trailing backslash on last line
  error in automake

It would be nice if automake would generate an error in all these
cases.

Volker
-- 
Volker Börchers
TECON Systems AG




reply via email to

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