0.9.1.52:
[sbcl.git] / doc / manual / make-tempfiles.sh
1 #!/bin/sh
2
3 # Create Texinfo snippets from the documentation of exported symbols.
4
5 # This software is part of the SBCL system. See the README file for
6 # more information.
7 #
8 # This software is in the public domain and is provided with
9 # absolutely no warranty. See the COPYING and CREDITS files for
10 # more information.
11
12 # how we invoke SBCL
13
14 # We create the documentation from the in-tree sbcl if it is found,
15 # else an installed sbcl is used.
16
17 if [ -z "$1" ]
18 then
19     sbclsystem=`pwd`/../../src/runtime/sbcl
20     sbclcore=`pwd`/../../output/sbcl.core
21     if [ -e $sbclsystem ] && [ -e $sbclcore ]
22     then
23         SBCLRUNTIME="$sbclsystem --core $sbclcore"
24         SBCL_HOME=`pwd`/../../contrib; export SBCL_HOME
25     else
26         SBCLRUNTIME="`which sbcl`"
27     fi
28 else
29     SBCLRUNTIME="$1"
30 fi
31
32 SBCL="$SBCLRUNTIME --noinform --sysinit /dev/null --userinit /dev/null --noprint --disable-debugger"
33
34 # extract version and date
35 VERSION=`$SBCL --eval '(write-line (lisp-implementation-version))' --eval '(sb-ext:quit)'`
36 MONTH=`date "+%Y-%m"`
37
38 sed -e "s/@VERSION@/$VERSION/" \
39     -e "s/@MONTH@/$MONTH/" < variables.template > variables.texinfo || exit 1
40
41 # Output directory.  This has to end with a slash (it's interpreted by
42 # Lisp's `pathname' function) or you lose.  This is normally set from
43 # Makefile.
44 DOCSTRINGDIR="${DOCSTRINGDIR:-docstrings/}"
45
46 # List of contrib modules that docstring docs will be created for.
47 # This is normally set from Makefile.
48 #MODULES="${MODULES:-sb-md5 :sb-rotate-byte}"
49
50 # List of package names that documentation will be created for.  This
51 # is normally set from Makefile.
52 #PACKAGES="${PACKAGES:-:COMMON-LISP :SB-ALIEN :SB-DEBUG :SB-EXT :SB-GRAY :SB-MOP :SB-PROFILE :SB-THREAD}"
53
54 echo /creating docstring snippets from SBCL=\'$SBCLRUNTIME\' for packages \'$PACKAGES\'
55 $SBCL <<EOF
56 (load "docstrings.lisp") 
57 (dolist (module (quote ($MODULES))) 
58   (require module)) 
59 (sb-texinfo:generate-includes "$DOCSTRINGDIR" $PACKAGES) 
60 (sb-ext:quit))
61 EOF
62
63 echo /creating package-locks.texi-temp
64 if $SBCL --eval "(let ((plp (find-symbol \"PACKAGE-LOCKED-P\" :sb-ext))) (quit :unix-status (if (and plp (fboundp plp)) 0 1)))";
65 then
66     cp package-locks-extended.texinfo package-locks.texi-temp
67 else
68     cp package-locks-basic.texinfo package-locks.texi-temp
69 fi