| 1 | #! /bin/sh
|
|---|
| 2 | # Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
|
|---|
| 3 | #
|
|---|
| 4 | # This file is part of GNU Automake.
|
|---|
| 5 | #
|
|---|
| 6 | # GNU Automake is free software; you can redistribute it and/or modify
|
|---|
| 7 | # it under the terms of the GNU General Public License as published by
|
|---|
| 8 | # the Free Software Foundation; either version 2, or (at your option)
|
|---|
| 9 | # any later version.
|
|---|
| 10 | #
|
|---|
| 11 | # GNU Automake is distributed in the hope that it will be useful,
|
|---|
| 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 14 | # GNU General Public License for more details.
|
|---|
| 15 | #
|
|---|
| 16 | # You should have received a copy of the GNU General Public License
|
|---|
| 17 | # along with Automake; see the file COPYING. If not, write to
|
|---|
| 18 | # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|---|
| 19 | # Boston, MA 02111-1307, USA.
|
|---|
| 20 |
|
|---|
| 21 | # Test to make sure that adding a new directory works.
|
|---|
| 22 | # This test runs `make' from the top-level directory, subdir8.test
|
|---|
| 23 | # do it from a subdirectory.
|
|---|
| 24 | # PR automake/46
|
|---|
| 25 |
|
|---|
| 26 | # This test assumes that the `make' utility is able to start
|
|---|
| 27 | # over and reload Makefiles which have been remade (a non-POSIX feature).
|
|---|
| 28 | required='GNUmake gcc'
|
|---|
| 29 | . ./defs || exit 1
|
|---|
| 30 |
|
|---|
| 31 | set -e
|
|---|
| 32 |
|
|---|
| 33 | cat > configure.in << 'END'
|
|---|
| 34 | AC_INIT(maude, 1.0)
|
|---|
| 35 | AM_INIT_AUTOMAKE
|
|---|
| 36 | AM_PROG_CC_C_O
|
|---|
| 37 | AC_PROG_CC
|
|---|
| 38 | AC_CONFIG_FILES(Makefile)
|
|---|
| 39 | AC_OUTPUT
|
|---|
| 40 | END
|
|---|
| 41 |
|
|---|
| 42 | cat > Makefile.am << 'END'
|
|---|
| 43 | bin_PROGRAMS = wish
|
|---|
| 44 | wish_SOURCES = a.c
|
|---|
| 45 | END
|
|---|
| 46 |
|
|---|
| 47 | cat > a.c << 'END'
|
|---|
| 48 | #include <stdio.h>
|
|---|
| 49 | int main ()
|
|---|
| 50 | {
|
|---|
| 51 | printf ("hi liver!\n");
|
|---|
| 52 | return 0;
|
|---|
| 53 | }
|
|---|
| 54 | END
|
|---|
| 55 |
|
|---|
| 56 | $ACLOCAL
|
|---|
| 57 | $AUTOCONF
|
|---|
| 58 | $AUTOMAKE --include-deps --copy --add-missing
|
|---|
| 59 | ./configure
|
|---|
| 60 | $MAKE
|
|---|
| 61 |
|
|---|
| 62 | # Now add a new directory.
|
|---|
| 63 | cat > configure.in << 'END'
|
|---|
| 64 | AC_INIT(maude, 1.0)
|
|---|
| 65 | AM_INIT_AUTOMAKE
|
|---|
| 66 | AM_PROG_CC_C_O
|
|---|
| 67 | AC_PROG_CC
|
|---|
| 68 | AC_CONFIG_FILES(Makefile maude/Makefile)
|
|---|
| 69 | m4_include([confile.m4])
|
|---|
| 70 | AC_OUTPUT
|
|---|
| 71 | END
|
|---|
| 72 |
|
|---|
| 73 | : > confile.m4
|
|---|
| 74 |
|
|---|
| 75 | mkdir maude
|
|---|
| 76 | cat > maude/Makefile.am << 'END'
|
|---|
| 77 | include_HEADERS = foo.h
|
|---|
| 78 | END
|
|---|
| 79 |
|
|---|
| 80 | : > maude/foo.h
|
|---|
| 81 |
|
|---|
| 82 | echo 'SUBDIRS = maude' >> Makefile.am
|
|---|
| 83 |
|
|---|
| 84 | # We want a simple rebuild to create maude/Makefile automatically.
|
|---|
| 85 | $MAKE
|
|---|
| 86 | test -f maude/Makefile
|
|---|
| 87 |
|
|---|
| 88 | # Add yet another directory
|
|---|
| 89 | mkdir maude2
|
|---|
| 90 | echo 'AC_CONFIG_FILES([maude2/Makefile])AC_SUBST([GREPME])' > confile.m4
|
|---|
| 91 | : > maude2/Makefile.am
|
|---|
| 92 | echo 'SUBDIRS += maude2' >> Makefile.am
|
|---|
| 93 |
|
|---|
| 94 | # We want a simple rebuild to create maude2/Makefile and update
|
|---|
| 95 | # all other Makefiles automatically.
|
|---|
| 96 | $MAKE
|
|---|
| 97 | grep GREPME Makefile
|
|---|
| 98 | grep GREPME maude/Makefile
|
|---|
| 99 | grep GREPME maude2/Makefile
|
|---|