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).
22 cat >> configure.in << 'END'
23 AC_CONFIG_FILES([dir/Makefile])
29 cat > Makefile.am << 'END'
30 BUILT_SOURCES = command1.inc
34 (echo '#! /bin/sh'; cat command1.inc) > $@
37 echo 'dir/echo.sh' > $@
38 CLEANFILES = subrun.sh command1.inc
41 cat > dir/Makefile.am << 'END'
42 BUILT_SOURCES = command2.inc
43 check_SCRIPTS = echo.sh
45 ## The next line ensures that command1.inc has been built before
46 ## recurring into the subdir.
47 test -f ../command1.inc
48 (echo '#! /bin/sh'; cat command2.inc) > $@
51 echo 'echo Hello' > $@
52 CLEANFILES = echo.sh command2.inc
58 ./configure --prefix "`pwd`/inst"
60 $MAKE check >stdout || { cat stdout; Exit 1; }
62 grep '^PASS: subrun\.sh *$' stdout
63 grep 'PASS.*echo\.sh' stdout && Exit 1
65 # check should depend directly on $(BUILT_SOURCES) (similar tests
66 # are in check.test and check2.test).
67 $EGREP '^check:.* \$\(BUILT_SOURCES\)( |$)' Makefile.in
68 $EGREP '^check:.* \$\(BUILT_SOURCES\)( |$)' dir/Makefile.in
72 test ! -f command1.inc
73 test ! -f dir/command2.inc
74 # Now make sure these two files are rebuilt during make install.
77 test -f dir/command2.inc