source: trunk/essentials/sys-devel/automake-1.8/tests/check3.test

Last change on this file was 3118, checked in by bird, 18 years ago

automake 1.8.5

File size: 2.1 KB
Line 
1#! /bin/sh
2# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
3#
4# This file is part of GNU Automake.
5#
6# GNU Automake is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2, or (at your option)
9# any later version.
10#
11# GNU Automake is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with Automake; see the file COPYING. If not, write to
18# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19# Boston, MA 02111-1307, USA.
20
21# Make sure `check:' and `install:' honor $(BUILT_SOURCES).
22# PR/359.
23
24. ./defs || exit 1
25
26set -e
27
28cat >> configure.in << 'END'
29AC_CONFIG_FILES([dir/Makefile])
30AC_OUTPUT
31END
32
33mkdir dir
34
35cat > Makefile.am << 'END'
36BUILT_SOURCES = command1.inc
37SUBDIRS = dir
38TESTS = subrun.sh
39subrun.sh:
40 (echo '#! /bin/sh'; cat command1.inc) > $@
41 chmod +x $@
42command1.inc:
43 echo 'dir/echo.sh' > $@
44CLEANFILES = subrun.sh command1.inc
45END
46
47cat > dir/Makefile.am << 'END'
48BUILT_SOURCES = command2.inc
49check_SCRIPTS = echo.sh
50echo.sh:
51## The next line ensures that command1.inc has been built before
52## recurring into the subdir.
53 test -f ../command1.inc
54 (echo '#! /bin/sh'; cat command2.inc) > $@
55 chmod +x $@
56command2.inc:
57 echo 'echo Hello' > $@
58CLEANFILES = echo.sh command2.inc
59END
60
61$ACLOCAL
62$AUTOCONF
63$AUTOMAKE
64./configure --prefix `pwd`/inst
65$MAKE check >stdout
66cat stdout
67grep 'PASS: subrun.sh' stdout
68
69# check should depend directly on check-am (similar tests are
70# in check.test and check2.test).
71$FGREP 'check: $(BUILT_SOURCES)' Makefile.in
72$FGREP 'check: $(BUILT_SOURCES)' dir/Makefile.in
73
74$MAKE clean
75# Sanity checks
76test ! -f command1.inc
77test ! -f dir/command2.inc
78# Now make sure these two files are rebuilt during make install.
79$MAKE install
80test -f command1.inc
81test -f dir/command2.inc
Note: See TracBrowser for help on using the repository browser.