tests: fix a timestamp-related spurious failures
[automake.git] / tests / subobj6.test
blob228a1e9744523d122edf8867e8085568b9926c1f
1 #! /bin/sh
2 # Copyright (C) 2001, 2002, 2003, 2004, 2010 Free Software Foundation,
3 # Inc.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
8 # any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 # Test of subdir make distclean rules.
19 # From Robert Collins
21 required=gcc
22 . ./defs || Exit 1
24 set -e
26 cat >> configure.in << 'END'
27 AM_PROG_CC_C_O
28 AC_OUTPUT
29 END
31 cat > Makefile.am << 'END'
32 AUTOMAKE_OPTIONS = subdir-objects
33 bin_PROGRAMS = wish
34 wish_SOURCES = generic/a.c
36 test-all: all
37 test -f generic/$(am__dirstamp)
38 test-mostlyclean: mostlyclean
39 test ! -f generic/a.o
40 test-distclean: distclean
41 test ! -f generic/$(am__dirstamp)
42 END
44 mkdir generic
45 cat > generic/a.c << 'END'
46 #include <stdio.h>
47 int main ()
49 printf ("maude!\n");
50 return 0;
52 END
54 $ACLOCAL
55 $AUTOCONF
56 $AUTOMAKE --include-deps --copy --add-missing
58 mkdir build
59 cd build
61 ../configure
62 $MAKE test-all
63 $MAKE test-mostlyclean
64 $MAKE test-distclean
66 cd ..
68 # Now test without the subdir.
69 cat > Makefile.am << 'END'
70 AUTOMAKE_OPTIONS = subdir-objects
71 bin_PROGRAMS = wish
72 wish_SOURCES = a.c
73 END
75 mv generic/a.c a.c
77 $ACLOCAL
78 $AUTOCONF
79 $AUTOMAKE --include-deps --copy --add-missing
81 mkdir build2
82 cd build2
84 ../configure
85 $MAKE
86 $MAKE mostlyclean