2001-09-09 Assar Westerlund * tests/target-rules.test: add a test for the previous change * lib/am/depend2.am (?!GENERIC?%OBJ%): do not give solaris make the chance of expanding the file name of the dependency Index: lib/am/depend2.am =================================================================== RCS file: /cvs/automake/automake/lib/am/depend2.am,v retrieving revision 1.39 diff -u -w -r1.39 depend2.am --- depend2.am 2001/05/14 09:39:24 1.39 +++ depend2.am 2001/09/09 19:01:50 @@ -37,8 +37,8 @@ depfile='$(DEPDIR)/%BASE%.Po' tmpdepfile='$(DEPDIR)/%BASE%.TPo' @AMDEPBACKSLASH@ $(%FPFX%DEPMODE) $(depcomp) @AMDEPBACKSLASH@ endif %AMDEP% -?-o? %COMPILE% %-c% %-o% %OBJ% `test -f %SOURCE% || echo '$(srcdir)/'`%SOURCE% -?!-o? %COMPILE% %-c% `test -f %SOURCE% || echo '$(srcdir)/'`%SOURCE% +?-o? %COMPILE% %-c% %-o% %OBJ% `AMFILENAME=%SOURCE%; test -f $$AMFILENAME || echo '$(srcdir)/'`%SOURCE% +?!-o? %COMPILE% %-c% `AMFILENAME=%SOURCE%; test -f $$AMFILENAME || echo '$(srcdir)/'`%SOURCE% ?GENERIC?.%EXT%.obj: ?!GENERIC?%OBJOBJ%: %SOURCE% Index: tests/Makefile.am =================================================================== RCS file: /cvs/automake/automake/tests/Makefile.am,v retrieving revision 1.345 diff -u -w -r1.345 Makefile.am --- Makefile.am 2001/08/23 05:00:34 1.345 +++ Makefile.am 2001/09/09 19:01:51 @@ -298,6 +298,7 @@ tagsub.test \ target.test \ target-cflags.test \ +target-rules.test \ texinfo.test \ texinfo2.test \ texinfo3.test \ Index: tests/target-rules.test =================================================================== RCS file: target-rules.test diff -N target-rules.test --- /dev/null Tue May 5 13:32:27 1998 +++ target-rules.test Sun Sep 9 12:01:51 2001 @@ -0,0 +1,50 @@ +#! /bin/sh + +# Test to make sure using the same source in multiple programs works with +# solaris make and vpath +# Assar Westerlund + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +AC_INIT(foo.c) +AM_INIT_AUTOMAKE(target-rules,0.0) +AC_PROG_CC +AC_OUTPUT(Makefile) +END + +cat > Makefile.am << 'END' +AUTOMAKE_OPTIONS = foreign no-dependencies + +bin_PROGRAMS = foo bar +foo_SOURCES = foo.c +foo_CFLAGS = -DFOO +bar_SOURCES = foo.c +bar_CFLAGS = -DBAR +END + +cat > foo.c << 'END' +#include +int main(void) { + return 0; +} +END + +# Fail gracefully if no autoconf. +$needs_autoconf + +# Likewise for gcc. +(gcc -v) > /dev/null 2>&1 || exit 77 + +$ACLOCAL +$AUTOCONF +$AUTOMAKE -a +mkdir obj + +cd obj +../configure +$MAKE + +cd .. +./configure +$MAKE