2f135a155fd1d5f8de10e3483f71d8fb4dde7662
[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         SBCL_BUILDING_CONTRIB="please asdf install your hook"; export SBCL_BUILDING_CONTRIB
26     else
27         SBCLRUNTIME="`which sbcl`"
28     fi
29 else
30     SBCLRUNTIME="$1"
31 fi
32
33 SBCL="$SBCLRUNTIME --noinform --sysinit /dev/null --userinit /dev/null --noprint --disable-debugger"
34
35 # extract version and date
36 VERSION=`$SBCL --eval '(write-line (lisp-implementation-version))' --eval '(sb-ext:quit)'`
37 MONTH=`date "+%Y-%m"`
38
39 sed -e "s/@VERSION@/$VERSION/" \
40     -e "s/@MONTH@/$MONTH/" < variables.template > variables.texinfo || exit 1
41
42 # Output directory.  This has to end with a slash (it's interpreted by
43 # Lisp's `pathname' function) or you lose.  This is normally set from
44 # Makefile.
45 DOCSTRINGDIR="${DOCSTRINGDIR:-docstrings/}"
46
47 # List of contrib modules that docstring docs will be created for.
48 # This is normally set from Makefile.
49 #MODULES="${MODULES:-sb-md5 :sb-rotate-byte}"
50
51 # List of package names that documentation will be created for.  This
52 # is normally set from Makefile.
53 #PACKAGES="${PACKAGES:-:COMMON-LISP :SB-ALIEN :SB-DEBUG :SB-EXT :SB-GRAY :SB-MOP :SB-PROFILE :SB-THREAD}"
54
55 echo /creating docstring snippets from SBCL=\'$SBCLRUNTIME\' for packages \'$PACKAGES\'
56 $SBCL <<EOF
57 (load "docstrings.lisp") 
58 (require :asdf)
59 (dolist (module (quote ($MODULES))) 
60   (require module)) 
61 (sb-texinfo:generate-includes "$DOCSTRINGDIR" $PACKAGES) 
62 (sb-ext:quit))
63 EOF
64
65 echo /creating package-locks.texi-temp
66 if $SBCL --eval "(let ((plp (find-symbol \"PACKAGE-LOCKED-P\" :sb-ext))) (quit :unix-status (if (and plp (fboundp plp)) 0 1)))";
67 then
68     cp package-locks-extended.texinfo package-locks.texi-temp
69 else
70     cp package-locks-basic.texinfo package-locks.texi-temp
71 fi