2 # Copyright (C) 2011-2017 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 # Test remake rules when m4 files get moved among different "include
18 # dirs" (i.e. those passed to aclocal with '-I' option).
22 cat >> configure.ac
<<'END'
27 cat > Makefile.am
<<'END'
28 ACLOCAL_AMFLAGS = -I d1 -I d2 -I d3
31 test '$(the_answer)' -eq 42
36 cat > d
1/macros.
m4 <<'END'
37 AC_DEFUN([MY_MACRO], [FOO])
40 cat > d
1/foo.
m4 <<'END'
41 AC_DEFUN([FOO], [the_answer=42; AC_SUBST([the_answer])])
52 mv d
1/foo.
m4 d
2/foo.
m4
53 using_gmake ||
$MAKE Makefile
56 ls -l $distdir $distdir/*
57 test -f $distdir/d
2/foo.
m4
58 test ! -e $distdir/d
1/foo.
m4
59 test -f $distdir/d
1/macros.
m4
60 test ! -e $distdir/d
2/macros.
m4
62 # Move both files at once.
63 mv d
1/macros.
m4 d
3/macros.
m4
64 mv d
2/foo.
m4 d
3/foo.
m4
65 using_gmake ||
$MAKE Makefile
68 ls -l $distdir $distdir/*
69 test -f $distdir/d
3/foo.
m4
70 test -f $distdir/d
3/macros.
m4
71 test ! -e $distdir/d
1/foo.
m4
72 test ! -e $distdir/d
2/foo.
m4
73 test ! -e $distdir/d
1/macros.
m4
74 test ! -e $distdir/d
2/macros.
m4