Merge branch 'yacc-quote-fix'
[automake.git] / tests / remake-subdir-from-subdir.test
blob22aafb45cc8601ae372df8c137f3126a6475b131
1 #! /bin/sh
2 # Copyright (C) 2009-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)
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 # Check that remake rules works for adding a new subdirectory from a
18 # pre-existing subdirectory.
19 # See also the other similar tests `remake-subdir*.test', and the
20 # related test `aclocal5.test'.
22 . ./defs || Exit 1
24 cat >> configure.in <<'END'
25 m4_include([subdirs.m4])
26 AC_SUBST([MAGIC], [magic])
27 AC_OUTPUT
28 END
30 echo 'AC_CONFIG_FILES([sub/Makefile])' > subdirs.m4
31 echo 'SUBDIRS = sub' > Makefile.am
33 mkdir sub
34 : > sub/Makefile.am
36 $ACLOCAL
37 $AUTOCONF
38 $AUTOMAKE
40 ./configure
41 $MAKE
43 cd sub
44 $sleep
45 echo 'AC_CONFIG_FILES([sub/subsub/Makefile])' >> ../subdirs.m4
46 echo 'SUBDIRS = subsub' >> Makefile.am
47 mkdir subsub
48 cat > subsub/Makefile.am <<'END'
49 all-local:
50 : > ok-it-works
51 END
52 using_gmake || $MAKE Makefile
53 $MAKE
54 test -f subsub/ok-it-works