doc: typos in test file.
[automake.git] / t / remake-config-status-dependencies.sh
blobdabb53ccfd09599c07dcd18a5ce6927086a99dd8
1 #! /bin/sh
2 # Copyright (C) 2013-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 CONFIG_STATUS_DEPENDENCIES.
19 . test-init.sh
21 cat >> configure.ac <<'END'
22 . ${srcdir}/version.sh
23 AC_SUBST([EXTRA_VERSION])
24 AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/version.sh'])
25 AC_OUTPUT
26 END
28 echo EXTRA_VERSION=1.0 > version.sh
30 cat > Makefile.am <<'END'
31 .PHONY: test-1 test-2 test-3
32 check-local: test-3
33 test-1:
34 test $(EXTRA_VERSION) = 1.0
35 test-2:
36 test $(EXTRA_VERSION) = 2.1
37 test-3:
38 test $(EXTRA_VERSION) = 3.14
39 END
41 $ACLOCAL
42 $AUTOCONF
43 $AUTOMAKE
45 ./configure
46 $MAKE test-1
48 $sleep
49 echo EXTRA_VERSION=2.1 > version.sh
50 using_gmake || $MAKE Makefile
51 $MAKE test-2
53 $MAKE distclean
54 mkdir build
55 cd build
56 ../configure
57 $MAKE test-2
58 $sleep
59 echo EXTRA_VERSION=3.14 > ../version.sh
60 using_gmake || $MAKE Makefile
61 $MAKE test-3
63 # Contents of $(CONFIG_STATUS_DEPENDENCIES) are *not* to be
64 # automatically distributed; there is no generic good reason
65 # for that.
66 $MAKE distdir
67 test ! -e $distdir/version.sh
68 test -f $distdir/configure || exit 99 # Sanity check.