2 # Copyright (C) 2001-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.
18 # This test runs 'make' from the top-level directory, the sister test
19 # 'subdir8.test' do it from a subdirectory.
24 cat >> configure.ac << 'END'
36 # Now add new directories.
38 # First we add a new directory by modifying configure.ac directly.
39 # We update configure.ac *before* updating sub/Makefile.am; subdir8.test
40 # does it in the other way: it updates confiles.m4 (which is m4_included
41 # by configure.ac there) after Makefile.am.
43 # Modified configure dependencies must be newer than config.status.
45 sed <configure.ac >configure.tmp -e '/^AC_OUTPUT$/i\
46 AC_CONFIG_FILES([maude/Makefile])\
47 m4_include([confile.m4])\
48 ' # Last newline required by older OpenBSD sed.
49 mv -f configure.tmp configure.ac
51 cat configure.ac # For debugging.
57 cat > maude/Makefile.am << 'END'
58 include_HEADERS = foo.h
63 echo 'SUBDIRS = maude' >> Makefile.am
65 # We want a simple rebuild to create maude/Makefile automatically.
67 grep '^SUBDIRS = *maude *$' Makefile.in
68 grep '^SUBDIRS = *maude *$' Makefile
69 test -f maude/Makefile
71 # Then we add a new directory by modifying a file included (through
72 # 'm4_include') by configure.ac.
74 # Modified configure dependencies must be newer than config.status.
76 cat >> confile.m4 << 'END'
77 AC_CONFIG_FILES([maude2/Makefile])
80 : > maude2/Makefile.am
81 echo 'SUBDIRS += maude2' >> Makefile.am
83 # We want a simple rebuild to create maude2/Makefile and update
84 # all other Makefiles automatically.
86 grep '^SUBDIRS =.* maude2' Makefile.in
87 grep '^SUBDIRS =.* maude2' Makefile
89 for ext in '.in' ''; do
90 for d in . maude maude2; do
91 grep '^GREPME =' $d/Makefile$ext