am-ft: make the environment available earlier
[platform/upstream/automake.git] / t / recurs-user-wrap.sh
1 #! /bin/sh
2 # Copyright (C) 2012-2013 Free Software Foundation, Inc.
3 #
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)
7 # any later version.
8 #
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.
13 #
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/>.
16
17 # Check that rules generated by user recursion are apt to be wrapped
18 # by other makefiles.
19
20 required=GNUmake
21 . test-init.sh
22
23 cat >> configure.ac << 'END'
24 AM_EXTRA_RECURSIVE_TARGETS([extra])
25 AC_CONFIG_FILES([src/Makefile])
26 AC_OUTPUT
27 END
28
29 mkdir src
30 echo SUBDIRS = src > Makefile.am
31 echo 'bar: ; : > $@ ' > src/Makefile.am
32
33 $ACLOCAL
34 $AUTOCONF
35 $AUTOMAKE
36
37 ./configure
38
39 $MAKE extra
40 test ! -f extra-local
41 test ! -f src/bar
42
43 cat > GNUmakefile << 'END'
44 .DEFAULT_GOAL = all
45 extra-local:
46         : > $@
47 include ./Makefile
48 END
49
50 cat > src/GNUmakefile << 'END'
51 include ./Makefile
52 extra-local: bar
53 END
54
55 $MAKE extra
56 test -f extra-local
57 test -f src/bar
58
59 :