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 user recursion works with "make -k".
21 cat >> configure.ac
<<'END'
22 AM_EXTRA_RECURSIVE_TARGETS([foo])
30 FAIL='@echo "FAIL $@ in `pwd`"; exit 1'
31 PASS='@echo "PASS $@ in `pwd`"; : > foo'
37 mkdir sub1 sub
1/subsub1 sub2 sub
2/subsub2 sub3
39 cat > Makefile.am
<<'END'
40 SUBDIRS = sub1 . sub2 sub3
44 cat > sub
1/Makefile.am
<<'END'
49 cat > sub
2/Makefile.am
<<'END'
54 echo 'foo-local:; @FAIL@' > sub
1/subsub
1/Makefile.am
55 echo 'foo-local:; @PASS@' > sub
2/subsub
2/Makefile.am
56 echo 'foo-local:; @PASS@' > sub
3/Makefile.am
72 find .
-name foo
> t ||
{ cat t
; exit 1; }
79 # Without "-k", we fail in 'sub1/subsub1', and do nothing else.
80 # So, no 'foo' file gets created.
82 find .
-name foo |
grep .
&& exit 1
85 $MAKE -k foo
&& exit 1
87 $MAKE --keep-going foo
&& exit 1
90 # Don't trust the exit status of 'make -k' for non-GNU makes.