[Top][All Lists]

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

backslashes in variable definition

From: Volker Boerchers
Subject: backslashes in variable definition
Date: Mon, 21 Jun 2004 16:38:23 +0200 (CEST)


the _SOURCES values of our's are split into multiple lines
to improve readability like this

  libfoo_la_SOURCES = \
        foo.c \

However if one forgets a backslash the source files after that are
silently ignored by automake.

  libfoo_la_SOURCES = \
        foo.c                  # missing '\' 

These errors are hard to detect, at least for libraries since missing
dependencies are detected later.

The output of the attached example is (using automake 1.5 or 1.7.6):

  $ ./
  automake: installing `./install-sh'
  automake: installing `./mkinstalldirs'
  automake: installing `./missing'
  automake: installing `./COPYING'
  automake: installing `./depcomp'

  $ ./configure

  $ make
  make  all-am
  make[1]: Entering directory `/home/vboerchers/hello'
  source='hello.c' object='hello.o' libtool=no \
  depfile='.deps/hello.Po' tmpdepfile='.deps/hello.TPo' \
  depmode=gcc /bin/sh ./depcomp \
  gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -c `test -f hello.c || echo 
  gcc  -g -O2   -o hello  hello.o  
  hello.o: In function `main':
  /home/vboerchers/hello/hello.c:2: undefined reference to `f'
  collect2: ld returned 1 exit status
  make[1]: *** [hello] Error 1
  make[1]: Leaving directory `/home/vboerchers/hello'
  make: *** [all] Error 2

  $ make clean
  test -z "hello" || rm -f hello
  rm -f ChangeLog AUTHORS INSTALL Makefile NEWS README
  rm -f aclocal.m4 config.h* depcomp install-sh missing mkinstalldirs
  rm -f stamp* COPYING configure config.*
  make: execvp: bar.c: Permission denied
  make: *** [clean-local] Error 127

Please note that the 'bar.c' is attached to the 'clean-local'-target
that is placed *before* the erroneous variable definition.

Would it be possible for automake to detect such errors, and to give a
warning like in case of trailing backslashes at the end of a variable

Volker Börchers
TECON Systems AG

Attachment: hello.tgz
Description: GNU Unix tar archive

reply via email to

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