Clarify overriding of `*_DEPENDENCIES' in LIBOBJS node.
[automake/ericb.git] / tests / check3.test
blob0050e45c19db132d722229386caeecf8d3fd33f3
1 #! /bin/sh
2 # Copyright (C) 2002, 2003, 2007 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 `check:' and `install:' honor $(BUILT_SOURCES).
18 # PR/359.
20 . ./defs || Exit 1
22 set -e
24 cat >> configure.in << 'END'
25 AC_CONFIG_FILES([dir/Makefile])
26 AC_OUTPUT
27 END
29 mkdir dir
31 cat > Makefile.am << 'END'
32 BUILT_SOURCES = command1.inc
33 SUBDIRS = dir
34 TESTS = subrun.sh
35 subrun.sh:
36 (echo '#! /bin/sh'; cat command1.inc) > $@
37 chmod +x $@
38 command1.inc:
39 echo 'dir/echo.sh' > $@
40 CLEANFILES = subrun.sh command1.inc
41 END
43 cat > dir/Makefile.am << 'END'
44 BUILT_SOURCES = command2.inc
45 check_SCRIPTS = echo.sh
46 echo.sh:
47 ## The next line ensures that command1.inc has been built before
48 ## recurring into the subdir.
49 test -f ../command1.inc
50 (echo '#! /bin/sh'; cat command2.inc) > $@
51 chmod +x $@
52 command2.inc:
53 echo 'echo Hello' > $@
54 CLEANFILES = echo.sh command2.inc
55 END
57 $ACLOCAL
58 $AUTOCONF
59 $AUTOMAKE
60 ./configure --prefix "`pwd`/inst"
61 $MAKE check >stdout
62 cat stdout
63 grep 'PASS: subrun.sh' stdout
65 # check should depend directly on check-am (similar tests are
66 # in check.test and check2.test).
67 $FGREP 'check: $(BUILT_SOURCES)' Makefile.in
68 $FGREP 'check: $(BUILT_SOURCES)' dir/Makefile.in
70 $MAKE clean
71 # Sanity checks
72 test ! -f command1.inc
73 test ! -f dir/command2.inc
74 # Now make sure these two files are rebuilt during make install.
75 $MAKE install
76 test -f command1.inc
77 test -f dir/command2.inc