2 # Copyright (C) 2012-2013 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 # Check that "./configure && make && make distclean" is actually a
18 # no-op, even when conditional SUBDIRS are involved.
22 cat >> configure.ac << 'END'
23 AC_CONFIG_FILES([sub1/Makefile sub2/Makefile sub1/subsub/Makefile])
24 AM_CONDITIONAL([COND], [false])
25 AC_SUBST([extra_subdirs], [''])
29 mkdir sub1 sub2 sub1/subsub
31 cat > Makefile.am << 'END'
38 cat > sub1/Makefile.am << 'END'
42 SUBDIRS = @extra_subdirs@
46 cat > sub2/Makefile.am << 'END'
48 @echo "Should not run in `pwd`!"
52 cp sub2/Makefile.am sub1/subsub/Makefile.am
56 $AUTOMAKE -c --add-missing
62 test -f sub1/subsub/Makefile
66 touch sub2/oops sub1/subsub/oops
71 test ! -e sub1/subsub/oops
72 test ! -e sub1/Makefile
73 test ! -e sub2/Makefile
74 test ! -e sub1/subsub/Makefile
85 test -f sub1/subsub/Makefile
88 touch sub2/oops sub1/subsub/oops
90 $MAKE maintainer-clean
93 test ! -e sub1/subsub/oops
94 test ! -e sub1/Makefile
95 test ! -e sub2/Makefile
96 test ! -e sub1/subsub/Makefile