2 # Copyright (C) 2012-2015 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 recursion on user-defined targets can be made to work
18 # with "deeply" nested uses of $(SUBDIRS).
22 cat >> configure.ac
<<'END'
26 sub1/sub2/sub3/Makefile
27 sub1/sub2/sub3/sub4/Makefile
29 AM_EXTRA_RECURSIVE_TARGETS([foo])
33 dirs='sub1 sub1/sub2 sub1/sub2/sub3 sub1/sub2/sub3/sub4'
37 cat > Makefile.am
<<'END'
42 MOSTLYCLEANFILES = foo
46 echo 'It works!' > exp
49 test ! -f sub1/sub2/foo
50 test ! -f sub1/sub2/sub3/foo
51 diff exp sub1/sub2/sub3/sub4/foo
58 cat > sub
1/Makefile.am
<<'END'
61 test ! -f sub2/sub3/foo
62 cp sub2/sub3/sub4/foo foo
63 MOSTLYCLEANFILES = foo
66 # Here we deliberately lack an explicit definition the 'foo-local'
67 # target; that shouldn't stop 'foo' recursion into subdirectory
69 echo SUBDIRS
= sub3
> sub
1/sub
2/Makefile.am
70 echo SUBDIRS
= sub4
> sub
1/sub
2/sub
3/Makefile.am
72 cat > sub
1/sub
2/sub
3/sub
4/Makefile.am
<<'END'
74 echo 'It works!' > foo
75 MOSTLYCLEANFILES = foo
83 $FGREP foo-am
$d/Makefile.
in ||
exit 1
86 *) $FGREP foo-recursive
$d/Makefile.
in ||
exit 1;;