Clarify overriding of `*_DEPENDENCIES' in LIBOBJS node.
[automake/ericb.git] / tests / subobj6.test
bloba7cf59d33bc43f011f45e8681c7cd0b4af3fe71a
1 #! /bin/sh
2 # Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
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 3, or (at your option)
7 # any later version.
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.
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/>.
17 # Test of subdir make distclean rules.
18 # From Robert Collins
20 required=gcc
21 . ./defs || Exit 1
23 cat >> configure.in << 'END'
24 AM_PROG_CC_C_O
25 AC_OUTPUT
26 END
28 cat > Makefile.am << 'END'
29 AUTOMAKE_OPTIONS = subdir-objects
30 bin_PROGRAMS = wish
31 wish_SOURCES = generic/a.c
33 test-all: all
34 test -f generic/$(am__dirstamp)
35 test-mostlyclean: mostlyclean
36 test ! -f generic/a.o
37 test-distclean: distclean
38 test ! -f generic/$(am__dirstamp)
39 END
41 # The ac-init file.
42 : > f
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 set -e
56 $ACLOCAL
57 $AUTOCONF
58 $AUTOMAKE --include-deps --copy --add-missing
60 mkdir build
61 cd build
63 ../configure
64 $MAKE test-all
65 $MAKE test-mostlyclean
66 $MAKE test-distclean
68 cd ..
70 # Now test without the subdir.
71 cat > Makefile.am << 'END'
72 AUTOMAKE_OPTIONS = subdir-objects
73 bin_PROGRAMS = wish
74 wish_SOURCES = a.c
75 END
77 mv generic/a.c a.c
79 $ACLOCAL
80 $AUTOCONF
81 $AUTOMAKE --include-deps --copy --add-missing
83 mkdir build2
84 cd build2
86 ../configure
87 $MAKE
88 $MAKE mostlyclean