- ln ChangeLog README ../${tempdir}/lisp
- cd ../${tempdir}/lisp
- rm -f TAGS =*
- rm -f site-init site-init.el site-init.elc
- rm -f site-load site-load.el site-load.elc
- rm -f default default.el default.elc)
-
-#echo "Making links to \`lisp/calc-2.02'."
-#### Don't distribute =*.el files, TAGS or backups.
-#(cd lisp/calc-2.02
-# ln [a-zA-Z]*.el ../../${tempdir}/lisp/calc-2.02
-# ln [a-zA-Z]*.elc ../../${tempdir}/lisp/calc-2.02
-# ln calc.info* calc.texinfo calc-refcard.* ../../${tempdir}/lisp/calc-2.02
-# ln INSTALL Makefile README README.prev ../../${tempdir}/lisp/calc-2.02
-# cd ../../${tempdir}/lisp/calc-2.02
-# rm -f *~ TAGS)
-
-echo "Making links to \`lisp/term'."
-### Don't distribute =*.el files or TAGS.
-(cd lisp/term
- ln [a-zA-Z]*.el ../../${tempdir}/lisp/term
- ln [a-zA-Z]*.elc ../../${tempdir}/lisp/term
- ln README ChangeLog ../../${tempdir}/lisp/term
- rm -f =* TAGS)
-
-### echo "Making links to \`external-lisp'."
-### ### Don't distribute =*.el files or TAGS.
-### (cd external-lisp
-### ln [a-zA-Z]*.el ../${tempdir}/external-lisp
-### ln [a-zA-Z]*.elc ../${tempdir}/external-lisp
-### ln ChangeLog README ../${tempdir}/external-lisp
-### rm -f =* TAGS)
-
-echo "Making links to \`src'."
+ ln ChangeLog Makefile makefile.nt ChangeLog.? ../${tempdir}/lisp
+ test -f README && ln README ../${tempdir}/lisp
+ (cd ../${tempdir}/lisp
+ rm -f TAGS =*
+ rm -f site-init site-init.el site-init.elc
+ rm -f site-load site-load.el site-load.elc
+ rm -f site-start site-start.el site-start.elc
+ rm -f default default.el default.elc
+ )
+
+ ## Find all subdirs of lisp dir
+ for file in `find . -type d -print`; do
+ case $file in
+ . | .. | */Old | */CVS | */RCS | */=*)
+ ;;
+ *)
+ if [ -d $file ]; then
+ subdirs="$file $subdirs"
+ fi
+ ;;
+ esac
+ done
+
+ for file in $subdirs; do
+ echo " lisp/$file"
+ mkdir ../${tempdir}/lisp/$file
+ ln $file/[a-zA-Z]*.el ../${tempdir}/lisp/$file
+ ln $file/[a-zA-Z]*.elc ../${tempdir}/lisp/$file
+ if [ -f $file/README ]; then
+ ln $file/README ../${tempdir}/lisp/$file
+ fi
+ if [ -f $file/ChangeLog ]; then
+ ln $file/ChangeLog ../${tempdir}/lisp/$file
+ fi
+ done )
+
+echo "Making links to \`leim' and its subdirectories for the LEIM distribution"
+### Don't distribute TAGS, or =*.el files.
+(cd leim
+ ln makefile.nt ../${tempdir}/real-leim
+ ln ChangeLog README ../${tempdir}/real-leim
+
+ ln CXTERM-DIC/*.tit ../${tempdir}/real-leim/CXTERM-DIC
+ ln SKK-DIC/README SKK-DIC/SKK-JISYO.L ../${tempdir}/real-leim/SKK-DIC
+ ln skk/*.el skk/*.elc ../${tempdir}/real-leim/skk
+ ln quail/*.el quail/*.elc ../${tempdir}/real-leim/quail
+
+ cp ../leim-Makefile.in ../${tempdir}/real-leim/Makefile.in
+
+ cd ../${tempdir}/real-leim
+ rm -f TAGS =* */=*)
+
+### Move the real-leim directory outside of Emacs proper.
+(cd ${tempparent}
+ mkdir ${emacsname}-leim
+ mkdir ${emacsname}-leim/${emacsname}
+ mv ${emacsname}/real-leim ${emacsname}-leim/${emacsname}/leim)
+
+echo "Making links to \`src'"