2 # Copyright (C) 2003-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 # Test to make sure that adding a new directory works, even from
18 # subdirectories. The sister test `subdir5.test' makes sure it works
19 # when make is run from the top-level directory.
24 cat >> configure.
in << 'END'
25 m4_include
([confiles.
m4])
30 echo 'AC_CONFIG_FILES([sub/Makefile])' > confiles.
m4
32 cat > Makefile.am
<< 'END'
34 ACLOCAL_AMFLAGS
= -I m4
42 echo 'AC_DEFUN([MORE_DEFS], [])' > m
4/moredefs.
m4
50 # Now add new directories.
52 # The first step users typically do when adding a new subdir is
53 # editing configure.in. That is already tested by subdir5.test,
54 # though, so here we try to just edit a file that is included by
55 # configure.in, without touching configure.in itself.
58 cat > sub
/maude
/Makefile.am
<< 'END'
59 include_HEADERS
= foo.h
64 echo 'SUBDIRS = maude' >> sub
/Makefile.am
69 # Update confiles.m4 *after* updating sub/Makefile.am; subdir5.test do
70 # it in the other way: it updates configure.in before Makefile.am.
71 # We sleep here because modified configure dependencies must be newer
74 echo 'AC_CONFIG_FILES([maude/Makefile sub/maude/Makefile])' >> confiles.
m4
76 # We want a simple rebuild from sub/ to create sub/maude/Makefile
77 # and maude/Makefile automatically.
81 grep '^SUBDIRS = *maude *$' sub
/Makefile.
in
82 grep '^SUBDIRS = *maude *$' sub
/Makefile
83 test -f maude
/Makefile
84 test -f sub
/maude
/Makefile
86 # Make sure the dependencies of aclocal.m4 or honored at least from
87 # the top-level directory.
88 echo 'AC_DEFUN([MORE_DEFS], [AC_SUBST([GREPME])])' > m
4/moredefs.
m4
91 for ext
in '.in' ''; do
92 for d
in . maude sub sub
/maude
; do
93 grep '^GREPME =' $d/Makefile
$ext