tests: Let 'ltorder.sh' run successfully with Guix dynamic loader
[automake.git] / t / recurs-user-phony.sh
blob791b0741263b10024032dd3f7e73b4bf9644c529
1 #! /bin/sh
2 # Copyright (C) 2012-2018 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)
7 # any later version.
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 <https://www.gnu.org/licenses/>.
17 # Check that user-defined recursive targets and their associate
18 # '-local', '-am' and '-recursive' targets are declared as phony.
20 # Require GNU make, because some vendo makes (e.g., Solaris) doesn't
21 # truly respect .PHONY.
22 required=GNUmake
23 . test-init.sh
25 cat >> configure.ac <<'END'
26 AC_CONFIG_FILES([sub/Makefile])
27 AM_EXTRA_RECURSIVE_TARGETS([foo])
28 AC_OUTPUT
29 END
31 cat > Makefile.am <<'END'
32 SUBDIRS = sub
33 foo-local:
34 echo 'GOOD!' > foo
35 END
37 mkdir sub
38 cat > sub/Makefile.am <<'END'
39 foo-local:
40 echo 'GOOD!' > foo
41 END
43 dummy_files='
44 foo
45 foo-local
46 foo-am
47 foo-recursive
48 sub/foo
49 sub/foo-local
50 sub/foo-am
53 $ACLOCAL
54 $AUTOCONF
55 $AUTOMAKE
56 ./configure
58 touch $dummy_files
60 $MAKE foo
61 grep 'GOOD!' foo
62 grep 'GOOD!' sub/foo