bug-automake
[Top][All Lists]
Advanced

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

compilation rules with dependencies don't work with subdir-objects


From: Bruno Haible
Subject: compilation rules with dependencies don't work with subdir-objects
Date: Wed, 8 Nov 2006 14:20:44 +0100
User-agent: KMail/1.9.1

Hi,

automake generated compilation rules involving object files in subdirectories
lead to a build failure. With 'no-dependencies', the build failure disappears.

$ automake --version
automake (GNU automake) 1.10
$ autoconf --version
autoconf (GNU Autoconf) 2.60
$ gcc -v
Reading specs from /usr/lib/gcc-lib/i586-suse-linux/3.3.1/specs

To reproduce:

$ mkdir testdir
$ cd testdir
$ mkdir gllib
$ mkdir gllib/foo
$ mkdir build-aux
$ cat > configure.ac << \EOF
AC_INIT([dummy], [0])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE

AM_CONFIG_HEADER([config.h])

AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_INSTALL
AC_PROG_MAKE_SET

AC_PROG_RANLIB

AC_SUBST([gl_LIBOBJS], [foo/bar.$ac_objext])
AC_SUBST([gl_LTLIBOBJS], [foo/bar.lo])

AC_OUTPUT([Makefile gllib/Makefile])
EOF
$ cat > Makefile.am << \EOF
AUTOMAKE_OPTIONS = 1.5 foreign
SUBDIRS = gllib
EOF
$ cat > gllib/Makefile.am << \EOF
AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects
noinst_LIBRARIES = libgnu.a
libgnu_a_SOURCES = dummy.c
libgnu_a_LIBADD = $(gl_LIBOBJS)
libgnu_a_DEPENDENCIES = $(gl_LIBOBJS)
noinst_HEADERS =
EXTRA_DIST = foo/bar.c
BUILT_SOURCES =
SUFFIXES =
MOSTLYCLEANFILES = core *.stackdump
MOSTLYCLEANDIRS =
CLEANFILES =
DISTCLEANFILES =
MAINTAINERCLEANFILES =
AM_CPPFLAGS =
EOF
$ cat > gllib/dummy.c << \EOF
typedef int dummy;
EOF
$ cat > gllib/foo/bar.c << \EOF
int bar () { return 42; }
EOF
$ aclocal
$ autoheader
$ automake --foreign --force-missing --add-missing
...
$ autoconf
$ ./configure
...
$ make
make  all-recursive
make[1]: Entering directory `/dev/shm/testdir'
Making all in gllib
make[2]: Entering directory `/dev/shm/testdir/gllib'
make  all-am
make[3]: Entering directory `/dev/shm/testdir/gllib'
depbase=`echo dummy.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
        gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT dummy.o -MD -MP -MF 
$depbase.Tpo -c -o dummy.o dummy.c &&\
        mv -f $depbase.Tpo $depbase.Po
depbase=`echo foo/bar.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
        gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT foo/bar.o -MD -MP -MF 
$depbase.Tpo -c -o foo/bar.o foo/bar.c &&\
        mv -f $depbase.Tpo $depbase.Po
cc1: No such file or directory: opening dependency file foo/.deps/bar.Tpo
make[3]: *** [foo/bar.o] Error 1
make[3]: Leaving directory `/dev/shm/testdir/gllib'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/dev/shm/testdir/gllib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/dev/shm/testdir'
make: *** [all] Error 2


Bruno




reply via email to

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