2 # Copyright (C) 2001-2018 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 <https://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
19 # test 'subdir-add2-pr46.sh' 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; the sister
40 # test 'subdir-add2-pr46.sh' does it in the other way: it updates
41 # confiles.m4 (which is m4_included by configure.ac there) after
44 # Modified configure dependencies must be newer than config.status.
46 sed <configure.ac
>configure.tmp
-e '/^AC_OUTPUT$/i\
47 AC_CONFIG_FILES([maude/Makefile])\
48 m4_include([confile.m4])\
49 ' # Last newline required by older OpenBSD sed.
50 mv -f configure.tmp configure.ac
52 cat configure.ac
# For debugging.
58 cat > maude
/Makefile.am
<< 'END'
59 include_HEADERS
= foo.h
64 echo 'SUBDIRS = maude' >> Makefile.am
66 # We want a simple rebuild to create maude/Makefile automatically.
68 grep '^SUBDIRS = *maude *$' Makefile.
in
69 grep '^SUBDIRS = *maude *$' Makefile
70 test -f maude
/Makefile
72 # Then we add a new directory by modifying a file included (through
73 # 'm4_include') by configure.ac.
75 # Modified configure dependencies must be newer than config.status.
77 cat >> confile.
m4 << 'END'
78 AC_CONFIG_FILES
([maude
2/Makefile
])
81 : > maude
2/Makefile.am
82 echo 'SUBDIRS += maude2' >> Makefile.am
84 # We want a simple rebuild to create maude2/Makefile and update
85 # all other Makefiles automatically.
87 grep '^SUBDIRS =.* maude2' Makefile.
in
88 grep '^SUBDIRS =.* maude2' Makefile
90 for ext
in '.in' ''; do
91 for d
in . maude maude2
; do
92 grep '^GREPME =' $d/Makefile
$ext