This is an old outstanding patch: http://lists.gnu.org/archive/html/automake-patches/2005-09/msg00013.html
* Stepan Kasal wrote on Tue, Sep 27, 2005 at 05:41:31PM CEST: > On Tue, Sep 27, 2005 at 05:23:43AM -0500, John Ratliff wrote: > > I tested it in Linux with automake 1.9.6 and it still doesn't work. > > indeed, I previously did some quick testing with rule .list-> .c, > and it worked. > > But for rules .foo -> .o it really doesn't work. > > I wrote a patch which fixes this. It applies to CVS version, but also > to 1.9.6, so you don't need to install the CVS versions. > Actually, I guess that you can directly patch /usr/bin/automake. > > Please find the patch attached to this mail. > (I haven't ran "make check" with it, sorry.) FWIW, make check passes with this. > Does this work for you? John confirmed the functionality of the patch. Below is a test case addition which exposes the failure and shows the fix. Cheers, Ralf > 2005-09-27 Stepan Kasal <[EMAIL PROTECTED]> > > * automake.in (handle_single_transform): Direct suffix rule preserves > the directory prefix, so the generated object name should contain > it, too. * tests/suffix12.test: New test. * tests/Makefile.am: Adjusted. --- /dev/null 1970-01-01 00:00:01.000000000 +0100 +++ tests/suffix12.test 2006-03-16 18:00:51.000000000 +0100 @@ -0,0 +1,56 @@ +#! /bin/sh +# Copyright (C) 2002, 2003, 2006 Free Software Foundation, Inc. +# +# This file is part of GNU Automake. +# +# GNU Automake is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# GNU Automake is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Automake; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. + +# Tests that Automake understands suffix rules with subdir objects. +# Reported by John Ratliff. + +. ./defs || exit 1 + +set -e + +cat >>configure.in <<EOF +AC_PROG_CC +AC_OUTPUT +EOF + +cat >Makefile.am << 'END' +AUTOMAKE_OPTIONS = subdir-objects +SUFFIXES = .baz .o +# we fake here: +.baz.o: + cp $< $@ + +bin_PROGRAMS = foo +foo_SOURCES = foo.c sub/bar.baz +print: + @echo BEGIN: $(foo_OBJECTS) :END +END + +mkdir sub +echo bar.baz > sub/bar.baz +echo 'int main() { return 0;}' > foo.c + +$ACLOCAL +$AUTOCONF +$AUTOMAKE -a +./configure +env OBJEXT=OBJ $MAKE -e print >stdout +cat stdout +grep 'BEGIN: foo.OBJ sub/bar.OBJ :END' stdout Index: tests/Makefile.am =================================================================== RCS file: /cvs/automake/automake/tests/Makefile.am,v retrieving revision 1.593 diff -u -r1.593 Makefile.am --- tests/Makefile.am 10 Mar 2006 12:02:26 -0000 1.593 +++ tests/Makefile.am 16 Mar 2006 18:00:18 -0000 @@ -515,6 +520,7 @@ suffix9.test \ suffix10.test \ suffix11.test \ +suffix12.test \ symlink.test \ symlink2.test \ symlink3.test \