* lib/am/lisp.am ($(am__ELCFILES)): Prevent races if the recover
[automake.git] / tests / lisp6.test
blob724c05205d4d3846381c0a8c1de34537004f83c8
1 #! /bin/sh
2 # Copyright (C) 2004, 2005 Free Software Foundation, Inc.
4 # This file is part of GNU Automake.
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.
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.
16 # You should have received a copy of the GNU General Public License
17 # along with GNU 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.
21 # Test for conditional _LISP.
23 required=emacs
24 . ./defs || exit 1
26 set -e
28 cat > Makefile.am << 'EOF'
29 dist_lisp_LISP = am-one.el
30 if WANT_TWO
31 dist_lisp_LISP += am-two.el
32 endif
33 dist_noinst_LISP = am-three.el
35 dist-test: distdir
36 test -f $(distdir)/am-one.el
37 test -f $(distdir)/am-two.el
38 test -f $(distdir)/am-three.el
39 EOF
41 cat >> configure.in << 'EOF'
42 AM_CONDITIONAL([WANT_TWO], test -n "$want_two")
43 AM_PATH_LISPDIR
44 AC_OUTPUT
45 EOF
47 echo "(provide 'am-one)" > am-one.el
48 echo "(require 'am-one)" > am-two.el
49 echo "(require 'am-one)" > am-three.el
51 $ACLOCAL
52 $AUTOCONF
53 $AUTOMAKE --add-missing
54 ./configure --with-lispdir=`pwd`/lisp
56 $MAKE
57 test -f am-one.elc
58 test ! -f am-two.elc
59 test -f am-three.elc
60 test -f elc-stamp
62 $MAKE install
63 test -f lisp/am-one.el
64 test -f lisp/am-one.elc
65 test ! -f lisp/am-two.el
66 test ! -f lisp/am-two.elc
67 test ! -f lisp/am-three.el
68 test ! -f lisp/am-three.elc
70 $MAKE dist-test
72 $MAKE distclean
73 test ! -f am-one.elc
74 test ! -f am-two.elc
75 test ! -f am-three.elc
76 test ! -f elc-stamp
79 ./configure --with-lispdir=`pwd`/lisp want_two=1
80 $MAKE
81 test -f am-one.elc
82 test -f am-two.elc
83 test -f am-three.elc
84 test -f elc-stamp
86 # Let's mutilate the source tree, the check the recover rule.
87 rm -f am-*.elc
88 $MAKE
89 test -f am-one.elc
90 test -f am-two.elc
91 test -f am-three.elc
92 test -f elc-stamp
94 $MAKE install
95 test -f lisp/am-one.el
96 test -f lisp/am-one.elc
97 test -f lisp/am-two.el
98 test -f lisp/am-two.elc
99 test ! -f lisp/am-three.el
100 test ! -f lisp/am-three.elc
102 $MAKE dist-test
104 $MAKE distclean
105 test ! -f am-one.elc
106 test ! -f am-two.elc
107 test ! -f am-three.elc
108 test ! -f elc-stamp