packaging: Bump to 1.14.1
[platform/upstream/automake.git] / t / remake-subdir-from-subdir.sh
1 #! /bin/sh
2 # Copyright (C) 2009-2013 Free Software Foundation, Inc.
3 #
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.
8 #
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.
13 #
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/>.
16
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*.sh', and the
20 # related test 'aclocal5.sh'.
21
22 . test-init.sh
23
24 cat >> configure.ac <<'END'
25 m4_include([subdirs.m4])
26 AC_SUBST([MAGIC], [magic])
27 AC_OUTPUT
28 END
29
30 echo 'AC_CONFIG_FILES([sub/Makefile])' > subdirs.m4
31 echo 'SUBDIRS = sub' > Makefile.am
32
33 mkdir sub
34 : > sub/Makefile.am
35
36 $ACLOCAL
37 $AUTOCONF
38 $AUTOMAKE
39
40 ./configure
41 $MAKE
42
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
55
56 :