tests: avoid a spurious failure on MSYS
[platform/upstream/automake.git] / t / subobj5.sh
1 #! /bin/sh
2 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
7 # any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17 # Test of subdir make dist rules.
18 # From Robert Collins.
19
20 required=cc
21 . test-init.sh
22
23 cat >> configure.ac << 'END'
24 AC_CONFIG_FILES([generic/Makefile])
25 AC_PROG_CC
26 AM_PROG_CC_C_O
27 AC_OUTPUT
28 END
29
30 cat > Makefile.am << 'END'
31 AUTOMAKE_OPTIONS = subdir-objects
32 bin_PROGRAMS = wish
33 wish_SOURCES = generic/a.c
34
35 .PHONY: test-distdir test-build
36 test-distdir: distdir
37         ls -l $(distdir) $(distdir)/* ;: For debugging.
38         test ! -r $(distdir)/a.c
39         test -f $(distdir)/generic/a.c
40 test-build: all
41         ls -l . generic ;: For debugging.
42         test -f generic/a.$(OBJEXT)
43         test -f wish$(EXEEXT)
44         test ! -r a.$(OBJEXT)
45         test ! -r a$(EXEEXT)
46         test ! -r generic/wish$(EXEEXT)
47         test ! -r generic/a$(EXEEXT)
48 END
49
50 mkdir generic
51 : > generic/Makefile.am
52
53 cat > generic/a.c << 'END'
54 int main (void)
55 {
56   return 0;
57 }
58 END
59
60 $ACLOCAL
61 $AUTOCONF
62 $AUTOMAKE --include-deps --copy --add-missing
63
64 ./configure
65
66 $MAKE test-distdir
67 $MAKE dist
68 $MAKE test-build
69
70 :