doc: update Vala documentation
[automake.git] / t / lisp-subdir-mix.sh
blob7080340f3217ea64cc2d66e0696801c8bd4f205d
1 #! /bin/sh
2 # Copyright (C) 2012-2024 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 <https://www.gnu.org/licenses/>.
17 # Check compiling elisp files in different subdirectories, where a
18 # file in a subdirectory might require a file in another one.
19 # This doesn't work out of the box, but can be made to work with a
20 # judicious use of $(AM_ELCFLAGS).
22 required=emacs
23 . test-init.sh
25 cat >> configure.ac << 'END'
26 AM_PATH_LISPDIR
27 AC_OUTPUT
28 END
30 cat > Makefile.am << 'END'
31 dist_lisp_LISP = \
32 am-here.el \
33 sub1/am-one.el \
34 sub2/am-two.el \
35 sub3/subsub/am-three.el
37 AM_ELCFLAGS = \
38 -L $(srcdir)/sub1 \
39 -L $(srcdir)/sub2 \
40 -L $(srcdir)/sub3/subsub
42 elc-test:
43 test -f sub1/am-one.elc
44 test -f sub2/am-two.elc
45 test -f sub3/subsub/am-three.elc
46 .PHONY: elc-test
47 check-local: elc-test
48 END
50 mkdir sub1 sub2 sub3 sub3/subsub
52 cat > am-here.el << 'END'
53 (provide 'am-here)
54 (require 'am-one)
55 (require 'am-two)
56 (require 'am-three)
57 END
59 cat > sub1/am-one.el << 'END'
60 (require 'am-here)
61 (provide 'am-one)
62 (require 'am-two)
63 (require 'am-three)
64 END
66 cat > sub2/am-two.el << 'END'
67 (require 'am-here)
68 (require 'am-one)
69 (provide 'am-two)
70 (require 'am-three)
71 END
73 cat > sub3/subsub/am-three.el << 'END'
74 (require 'am-here)
75 (require 'am-one)
76 (require 'am-two)
77 (provide 'am-three)
78 END
80 $ACLOCAL
81 $AUTOCONF
82 $AUTOMAKE --add-missing
84 ./configure
86 $MAKE
87 $MAKE elc-test
88 $MAKE clean
89 for x in am-here sub1/am-one sub2/am-two sub3/subsub/am-three; do
90 test -f $x.el
91 test ! -e $x.elc
92 done
94 $MAKE distcheck