2 # Copyright (C) 2003, 2004 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 # Test to make sure that adding a new directory works, even from
18 # subdirectories. (subdir5.test makes sure it works when make
19 # is run from the top-level directory.)
22 # This test assumes that the `make' utility is able to start
23 # over and reload Makefiles which have been remade (a non-POSIX feature).
24 required
='GNUmake gcc'
29 echo 'AC_CONFIG_FILES([sub/Makefile])' >confiles.
m4
31 cat >> configure.
in << 'END'
34 m4_include
([confiles.
m4])
39 cat > Makefile.am
<< 'END'
41 ACLOCAL_AMFLAGS
= -I m4
46 cat > sub
/Makefile.am
<< 'END'
51 cat > sub
/a.c
<< 'END'
55 printf ("hi liver!\n");
61 echo 'AC_DEFUN([MORE_DEFS], [])' > m
4/moredefs.
m4
65 $AUTOMAKE --copy --add-missing
69 # Now add a new directory.
72 cat > sub
/maude
/Makefile.am
<< 'END'
73 include_HEADERS
= foo.h
78 echo 'SUBDIRS = maude' >> sub
/Makefile.am
83 # Update confile.m4 *after* updating sub/Makefile.am.
84 # (subdir5.test do it in the other way: it updates configure.in
86 echo 'AC_CONFIG_FILES([maude/Makefile sub/maude/Makefile])' >> confiles.
m4
88 # We want a simple rebuild from sub/ to create sub/maude/Makefile
89 # and maude/Makefile automatically.
93 test -f maude
/Makefile
94 test -f sub
/maude
/Makefile
96 # Make sure the dependencies of aclocal.m4 or honored at least from
97 # the top-level directory.
98 echo 'AC_DEFUN([MORE_DEFS], [AC_SUBST([GREPME])])' > m
4/moredefs.
m4
101 grep GREPME maude
/Makefile
102 grep GREPME sub
/Makefile
103 grep GREPME sub
/maude
/Makefile