cosmetics: remove few occurrences of trailing whitespace
[platform/upstream/automake.git] / t / extradep2.sh
1 #! /bin/sh
2 # Copyright (C) 2010-2013 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 # Test EXTRA_*_DEPENDENCIES, libtool version; see 'extradep.sh'.
18
19 required='cc libtoolize'
20 . test-init.sh
21
22 cat >> configure.ac << 'END'
23 AC_PROG_CC
24 AM_PROG_AR
25 AC_PROG_LIBTOOL
26 AC_SUBST([deps], [bardep])
27 AC_OUTPUT
28 END
29
30 cat > Makefile.am << 'END'
31 noinst_LTLIBRARIES = libfoo.la
32 EXTRA_libfoo_la_DEPENDENCIES = libfoodep
33 libfoodep:
34         @echo making $@
35         @: > $@
36 CLEANFILES = libfoodep
37
38 bin_PROGRAMS = bar
39 bar_LDADD = libfoo.la
40 EXTRA_bar_DEPENDENCIES = $(deps)
41
42 EXTRA_DIST = bardep
43
44 .PHONY: bar-has-been-updated
45 bar-has-been-updated:
46         is_newest bar$(EXEEXT) libfoo.la
47 END
48
49 cat >libfoo.c <<'END'
50 int libfoo () { return 0; }
51 END
52
53 cat >bar.c <<'END'
54 extern int libfoo ();
55 int main () { return libfoo (); }
56 END
57
58 libtoolize
59 $ACLOCAL
60 $AUTOMAKE --add-missing
61 $AUTOCONF
62
63 ./configure
64
65 # Hypothesis: EXTRA_*_DEPENDENCIES are honored.
66
67 : >foodep
68 : >foodep2
69 : >bardep
70 $MAKE >stdout || { cat stdout; exit 1; }
71 cat stdout
72 grep 'making libfoodep' stdout
73
74 rm -f bardep
75 $MAKE && exit 1
76 : >bardep
77
78 $MAKE
79 $sleep
80 touch libfoo.la
81 $MAKE
82 $MAKE bar-has-been-updated
83
84 $MAKE distcheck
85
86 :