tests: work around strangeness in MSYS
[automake.git] / tests / colon6.test
blob6aac84a1ab707fecf2cdcfe903c3a7e9049b5b0a
1 #! /bin/sh
2 # Copyright (C) 1998, 2000, 2001, 2002, 2010, 2011 Free Software
3 # Foundation, 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 # Yet another multi-":" test, this time from Ken Pizzini.
20 . ./defs || Exit 1
22 cat > configure.in <<END
23 AC_INIT([$me], [1.0])
24 AM_INIT_AUTOMAKE
25 # With this, version.good should depend on version.gin, while
26 # Makefile should not depend on either of them.
27 AC_CONFIG_FILES([demo/Makefile demo/version.good:demo/version.gin])
28 AC_OUTPUT
29 END
31 mkdir demo
32 : > demo/version.gin
33 : > demo/Makefile.am
35 $ACLOCAL
36 $AUTOMAKE
38 # These are older "grepping checks", kept mostly for backward-compatibility.
39 # They might (unlikely, but possibly) require updating when automake
40 # internals are changed. Just relax or remove if they become too fragile.
41 $EGREP 'Makefile:.*(demo|version)' demo/Makefile.in && Exit 1
42 grep 'version\.good:.*version\.gin' demo/Makefile.in
44 $AUTOCONF
46 for vpath in : false; do
48 if $vpath; then
49 srcdir=..
50 mkdir build
51 cd build
52 else
53 srcdir=.
56 $srcdir/configure
58 test -f demo/version.good # Sanity check.
59 test ! -s demo/version.good # Likewise.
61 cd demo
63 $sleep
64 # HP-UX make considers targets with exact time stamps as one of their
65 # prerequisites out of date. Ensure Makefile is newer than config.status to
66 # avoid triggering the am--refresh rule in the (here-nonexistent) toplevel
67 # Makefile.
68 touch Makefile
70 # version.good should depend on version.gin.
71 echo "Rebuilt (srcdir=$srcdir)" > ../$srcdir/demo/version.gin
72 $MAKE version.good
73 $FGREP "Rebuilt (srcdir=$srcdir)" version.good
75 # Makefile should not depend on version.good.
76 rm -f version.good
77 $MAKE Makefile
78 test ! -r version.good
80 # version.good should be rebuilt from version.gin.
81 $MAKE version.good
82 test -f version.good
84 # Makefile should not depend on version.gin.
85 rm -f ../$srcdir/demo/version.gin
86 $MAKE Makefile
87 test ! -r ../$srcdir/demo/version.gin # Sanity check.
89 # version.good should depend on version.gin.
90 rm -f version.good
91 $MAKE version.good >output 2>&1 && { cat output; Exit 1; }
92 cat output
93 # Try to verify that we errored out for the right reason.
94 $FGREP version.gin output
96 cd .. # Back in top builddir.
97 cd $srcdir
99 # Re-create it for the next pass (if any).
100 : > demo/version.gin
102 done