silent: new $(AM_V_P) variable, tell if we're running in silent mode
[platform/upstream/automake.git] / t / instdir.sh
1 #! /bin/sh
2 # Copyright (C) 2009-2012 Free Software Foundation, Inc.
3 #
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.
8 #
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.
13 #
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/>.
16
17 # If $(foodir) is the empty string, then nothing should be installed there.
18 # This test only ensures this if $(foo_PRIMARY) is also empty, see
19 # instdir2.test and siblings instdir-*.test for nonempty contents.
20
21 . ./defs || Exit 1
22
23 cat >>configure.ac <<'END'
24 AC_SUBST([foodir], ['${datadir}'/foo])
25 AC_OUTPUT
26 END
27
28 cat >Makefile.am <<'END'
29 bin_SCRIPTS =
30 nobase_bin_SCRIPTS =
31 data_DATA =
32 nobase_data_DATA =
33 include_HEADERS =
34 nobase_include_HEADERS =
35 foo_DATA =
36 nobase_foo_DATA =
37 bardir = $(datadir)/bar
38 bar_DATA =
39 nobase_bar_DATA =
40 man1_MANS =
41 man_MANS =
42 notrans_man1_MANS =
43 notrans_man_MANS =
44 END
45
46 $ACLOCAL
47 $AUTOCONF
48 $AUTOMAKE --add-missing
49
50 instdir=`pwd`/inst
51 destdir=`pwd`/dest
52 mkdir build
53 cd build
54 ../configure --prefix="$instdir"
55 $MAKE
56
57 bindir= datadir= includedir= foodir= bardir= man1dir= man2dir=
58 export bindir datadir includedir foodir bardir man1dir man2dir
59
60 $MAKE -e install
61 test ! -d "$instdir"
62 $MAKE -e install DESTDIR="$destdir"
63 test ! -d "$instdir"
64 test ! -d "$destdir"
65 $MAKE -e uninstall > stdout || { cat stdout; Exit 1; }
66 cat stdout
67 grep 'rm -f' stdout && Exit 1
68 $MAKE -e uninstall DESTDIR="$destdir"
69
70 :