Fix release-related things
[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     . ../../sbcl-pwd.sh
20     sbcl_pwd
21
22     sbclsystem=$SBCL_PWD/../../src/runtime/sbcl
23     sbclcore=$SBCL_PWD/../../output/sbcl.core
24     if [ -f $sbclsystem ] && [ -f $sbclcore ]
25     then
26         SBCLRUNTIME="$sbclsystem --core $sbclcore"
27         SBCL_HOME=$SBCL_PWD/../../obj/sbcl-home/; export SBCL_HOME
28         SBCL_BUILDING_CONTRIB="please asdf install your hook"; export SBCL_BUILDING_CONTRIB
29     else
30         SBCLRUNTIME="`which sbcl`"
31     fi
32 else
33     SBCLRUNTIME="$1"
34 fi
35
36 SBCL="$SBCLRUNTIME --noinform --no-sysinit --no-userinit --noprint --disable-debugger"
37
38 # extract version and date
39 VERSION=`$SBCL --eval '(write-line (lisp-implementation-version))' --eval '(sb-ext:exit)'`
40 MONTH=`date "+%Y-%m"`
41
42 sed -e "s/@VERSION@/$VERSION/" \
43     -e "s/@MONTH@/$MONTH/" < variables.template > variables.texinfo || exit 1
44
45 # Output directory.  This has to end with a slash (it's interpreted by
46 # Lisp's `pathname' function) or you lose.  This is normally set from
47 # Makefile.
48 DOCSTRINGDIR="${DOCSTRINGDIR:-docstrings/}"
49
50 # List of contrib modules that docstring docs will be created for.
51 # This is normally set from Makefile.
52 #MODULES="${MODULES:-sb-md5 :sb-rotate-byte}"
53
54 # List of package names that documentation will be created for.  This
55 # is normally set from Makefile.
56 #PACKAGES="${PACKAGES:-:COMMON-LISP :SB-ALIEN :SB-DEBUG :SB-EXT :SB-GRAY :SB-MOP :SB-PROFILE :SB-THREAD}"
57
58 echo /creating docstring snippets from SBCL=\'$SBCLRUNTIME\' for packages \'$PACKAGES\'
59 $SBCL <<EOF
60 (load "docstrings.lisp")
61 (require :asdf)
62 (dolist (module (quote ($MODULES)))
63   (require module))
64 (sb-texinfo:generate-includes "$DOCSTRINGDIR" $PACKAGES)
65 (sb-ext:exit))
66 EOF
67
68 echo /creating package-locks.texi-temp
69 if $SBCL --eval "(let ((plp (find-symbol \"PACKAGE-LOCKED-P\" :sb-ext))) (exit :code (if (and plp (fboundp plp)) 0 1)))";
70 then
71     cp package-locks-extended.texinfo package-locks.texi-temp
72 else
73     cp package-locks-basic.texinfo package-locks.texi-temp
74 fi
75
76 echo /creating encodings.texi-temp
77 $SBCL <<EOF
78 (with-open-file (s "encodings.texi-temp" :direction :output :if-exists :supersede)
79   (let (result)
80     (sb-int:dohash ((key val) sb-impl::*external-formats*)
81       (pushnew (sb-impl::ef-names val) result :test #'equal))
82     (setq result (sort result #'string< :key #'car))
83     (format s "@table @code~%~%")
84     (loop for (cname . names) in result
85           do (format s "@item ~S~%~{@code{~S}~^, ~}~%~%" cname names))
86     (format s "@end table~%")))
87 EOF