doc: update Vala documentation
[automake.git] / t / remake-renamed-m4-file.sh
blob60a39f4d1a1c1ade5cd3de2bb8cfab99765c8d43
1 #! /bin/sh
2 # Copyright (C) 2011-2024 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 # Test remake rules when m4 files get renamed.
19 . test-init.sh
21 cat >> configure.ac <<'END'
22 MY_MACRO
23 AC_OUTPUT
24 END
26 cat > Makefile.am <<'END'
27 ACLOCAL_AMFLAGS = -I m4
28 .PHONY: test
29 test:
30 test '$(the_answer)' -eq 42
31 END
33 mkdir m4
35 cat > m4/macros.m4 <<'END'
36 AC_DEFUN([MY_MACRO], [FOO])
37 END
39 cat > m4/foo.m4 <<'END'
40 AC_DEFUN([FOO], [the_answer=42; AC_SUBST([the_answer])])
41 END
43 $ACLOCAL -I m4
44 $AUTOCONF
45 $AUTOMAKE
47 ./configure
48 $MAKE test
50 # Rename one file at the time.
52 mv m4/foo.m4 m4/bar.m4
53 using_gmake || $MAKE Makefile
54 $MAKE test
55 $MAKE distdir
56 ls -l $distdir $distdir/*
57 test -f $distdir/m4/bar.m4
58 test ! -e $distdir/m4/foo.m4
60 mv m4/macros.m4 m4/defs.m4
61 using_gmake || $MAKE Makefile
62 $MAKE test
63 $MAKE distdir
64 ls -l $distdir $distdir/*
65 test -f $distdir/m4/defs.m4
66 test ! -e $distdir/m4/macros.m4
68 # Rename both files at once.
70 mv m4/bar.m4 m4/quux.m4
71 mv m4/defs.m4 acinclude.m4
72 using_gmake || $MAKE Makefile
73 $MAKE test
74 $MAKE distdir
75 ls -l $distdir $distdir/*
76 test -f $distdir/m4/quux.m4
77 test -f $distdir/acinclude.m4
78 test ! -e $distdir/m4/foo.m4
79 test ! -e $distdir/m4/bar.m4
80 test ! -e $distdir/m4/macros.m4
81 test ! -e $distdir/m4/defs.m4