Clarify overriding of `*_DEPENDENCIES' in LIBOBJS node.
[automake/ericb.git] / tests / distcleancheck.test
blob5f66a12680e7146fc966aabd5123b89fc969c474
1 #! /bin/sh
2 # Copyright (C) 2008 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 # Make sure the suggested `distcleancheck_listfiles' in the manual works.
18 # The example Makefile.am we use is from the FAQ entry `distcleancheck'.
20 . ./defs || Exit 1
22 set -e
24 cat >>configure.in << 'END'
25 AC_PROG_CC
26 AC_OUTPUT
27 END
29 cat > Makefile.am << 'END'
30 # This Makefile.am is bogus. See @node{distcleancheck} in the manual
31 # for how to fix it properly.
32 bin_PROGRAMS = foo
33 foo_SOURCES = foo.c
34 dist_man_MANS = foo.1
36 foo.1: foo$(EXEEXT)
37 echo man page for foo$(EXEEXT) > foo.1
39 ## Ignore warnings about overridden variables
40 AUTOMAKE_OPTIONS = -Wno-override
41 distcleancheck_listfiles = \
42 find . -type f -exec sh -c 'test -f $(srcdir)/$$1 || echo $$1' \
43 sh '{}' ';'
44 END
46 cat >foo.c <<'END'
47 int main () { return 0; }
48 END
50 $ACLOCAL
51 $AUTOCONF
52 $AUTOMAKE
54 ./configure
55 $MAKE
56 $MAKE distcheck
58 # Now ensure that we really needed the override.
59 sed '/distcleancheck_listfiles/,$d' Makefile.am > t
60 mv -f t Makefile.am
61 $AUTOMAKE
62 ./configure
63 $MAKE
64 $MAKE -e distcheck && Exit 1