2 # Copyright (C) 2002-2012 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 2, or (at your option)
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).
20 # For gen-testsuite-part: ==> try-with-serial-tests <==
23 cat >> configure.ac << 'END'
24 AC_CONFIG_FILES([dir/Makefile])
30 cat > Makefile.am << 'END'
31 BUILT_SOURCES = command1.inc
35 (echo '#! /bin/sh'; cat command1.inc) > $@
38 echo 'dir/echo.sh' > $@
39 CLEANFILES = subrun.sh command1.inc
42 cat > dir/Makefile.am << 'END'
43 BUILT_SOURCES = command2.inc
44 check_SCRIPTS = echo.sh
46 ## The next line ensures that command1.inc has been built before
47 ## recurring into the subdir.
48 test -f ../command1.inc
49 (echo '#! /bin/sh'; cat command2.inc) > $@
52 echo 'echo Hello' > $@
53 CLEANFILES = echo.sh command2.inc
59 ./configure --prefix "$(pwd)/inst"
61 $MAKE check >stdout || { cat stdout; exit 1; }
63 grep '^PASS: subrun\.sh *$' stdout
64 grep 'PASS.*echo\.sh' stdout && exit 1
66 # check should depend directly on $(BUILT_SOURCES) (similar tests
67 # are in check.sh and check2.sh).
68 $EGREP '^check:.* \$\(BUILT_SOURCES\)( |$)' Makefile.in
69 $EGREP '^check:.* \$\(BUILT_SOURCES\)( |$)' dir/Makefile.in
73 test ! -e command1.inc
74 test ! -e dir/command2.inc
75 # Now make sure these two files are rebuilt during make install.
78 test -f dir/command2.inc