2 # Copyright (C) 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 # Check that user recursion can be made to work when $(SUBDIRS) are
18 # not "strictly" nested, as in e.g.:
19 # SUBDIRS = src external/lib external/tests
20 # with no Makefile in 'external'.
24 cat >> configure.ac <<'END'
28 dnl There's deliberately no 'sub3/Makefile'.
33 AM_EXTRA_RECURSIVE_TARGETS([foo])
37 mkdir sub1 sub2 sub3 sub4 sub3/subsub sub4/subsub
39 cat > Makefile.am <<'END'
40 SUBDIRS = sub1 sub2 sub3/subsub sub4 sub4/subsub
44 MOSTLYCLEANFILES = foo
49 grep ':sub1:' sub1/foo
50 grep ',sub1,' sub1/bar
53 grep '%sub3/subsub%' sub3/subsub/quux
54 test ! -r sub3/subsub/foo
56 grep '=sub4/subsub=' sub4/subsub/foo
61 # A 'foo-local' target with dependencies shouldn't cause problems.
62 cat > sub1/Makefile.am <<'END'
64 sed 's/,/:/g' bar >foo
67 MOSTLYCLEANFILES = foo bar
70 # The lack of a 'foo' target here shouldn't cause any error in
71 # automake nor in make.
74 # The lack of file 'sub3/Makefile.am' shouldn't cause any problem either.
75 rm -f sub3/Makefile.am
77 # A 'foo-local' creating a file != 'foo' shouldn't cause any problem.
78 cat > sub3/subsub/Makefile.am <<'END'
80 echo '%sub3/subsub%' >quux
81 MOSTLYCLEANFILES = quux
84 # No 'foo-local' nor 'foo' target here ...
86 # ... should not cause errors, nor cause the 'foo-local' target
87 # here not to be executed.
88 cat > sub4/subsub/Makefile.am <<'END'
90 echo '=sub4/subsub=' >foo
91 MOSTLYCLEANFILES = foo