news: add entry about recent 'ar-lib' changes
[automake.git] / tests / make-dryrun.test
blob072d02fbd669a80f0d4211d47d3c8b8f7af9c327
1 #! /bin/sh
2 # Copyright (C) 2012 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 <http://www.gnu.org/licenses/>.
17 # Check that $(am__make_dryrun) works as expected.
19 . ./defs || Exit 1
21 set -e
23 mkdir sub
25 echo AC_OUTPUT >> configure.in
27 cat > Makefile.am <<'END'
28 all:
29 : Dummy, nothing to do.
30 foo:
31 $(MAKE) all
32 notdry:
33 @echo ":: $$MAKEFLAGS ::"; : For debugging.
34 $(am__make_dryrun) && exit 1; exit 0
35 dry:
36 +@echo ":: $$MAKEFLAGS ::"; : For debugging.
37 +$(am__make_dryrun) || exit 1; echo ok > from-dry-mode
38 END
40 $ACLOCAL
41 $AUTOCONF
42 $AUTOMAKE
43 ./configure
45 $MAKE notdry
47 # Test against a known regressions. This was especially
48 # heinous, since make running in normal mode was sometimes
49 # mistaken for make running in dry mode.
50 $MAKE notdry TESTS="n1.test n2.test"
51 $MAKE notdry TESTS="n1 n2" AM_MAKEFLAGS="TESTS='n1 n2'"
52 $MAKE notdry TESTS="n1 n2" AM_MAKEFLAGS='TESTS="n1 n2"'
53 $MAKE notdry FOOFLAGS="-n -n -knf2 \\n --none -n"
54 $MAKE notdry BARFLAGS="-n \"n\" '-n' --none -n"
56 if echo 'all: ; @+printf %sbb%s aa cc' | $MAKE -n -f - | grep aabbcc; then
57 $MAKE -n dry
58 test -f from-dry-mode
59 rm -f from-dry-mode
62 if using_gmake; then
63 $MAKE --dry-run -k dry
64 test -f from-dry-mode