Regenerate xperfecthashN.lisp-expr from scratch via build-all-cores
[sbcl.git] / slam.sh
blob6e79da91f9509c0c2a67f0e6710b4cdcf4bdfad7
1 #!/bin/sh
2 set -e
4 # a quick and dirty way of partially rebuilding the system after a
5 # change
7 # ("smooth duct tape: the mark of a true craftsman":-)
9 # This software is part of the SBCL system. See the README file for
10 # more information.
12 # This software is derived from the CMU CL system, which was
13 # written at Carnegie Mellon University and released into the
14 # public domain. The software is in the public domain and is
15 # provided with absolutely no warranty. See the COPYING and CREDITS
16 # files for more information.
18 #######################################################################
19 # You probably don't want to be using this script unless you
20 # understand the ordinary system build process pretty well already.
22 # This script is not a reliable way to build the system, but it is
23 # fast.:-| It can be useful if you are trying to debug a low-level
24 # problem, e.g. a problem in src/runtime/*.c or in
25 # src/code/cold-init.lisp. Soon, you'll find yourself wanting to
26 # test a small change in a file compiled into cold-sbcl.core without
27 # redoing the entire rebuild-the-system-from-scratch process. You may be
28 # able to avoid a complete make-host-2.sh by just letting this script
29 # rebuild only files that have changed. On the other hand, it might
30 # not work...
32 # It's not anywhere rigorously correct for all small changes, much
33 # less for all large changes. It can't be, unless we either solve the
34 # halting problem or totally rearchitect the SBCL sources to support
35 # incremental recompilation. Beyond that fundamental limitation, even
36 # an easy special case might not work unless someone's paid attention
37 # to making it work. Here are some highlights to help you understand
38 # when it will work:
39 # * It will rebuild a .fasl file when the corresponding
40 # .lisp file is out of date.
41 # * It rebuilds the src/runtime/ files completely, since that
42 # doesn't take very long anyway.
43 # * Apparently it will not rebuild assembly-code-in-.lisp files
44 # even when the sources are out of date. This is probably not a
45 # fundamental limitation, it's just that I (WHN 2002-01-16)
46 # have made vanishingly nontrivial changes to assembler files,
47 # so I'm not motivated. If you're motivated, please send a patch.
48 # * It will not notice when you change something in one .lisp file
49 # which should affect the compilation of code in another .lisp
50 # file. E.g.
51 # ** changing the definition of a macro used in another file (or a
52 # function or a variable which is used at macroexpansion time)
53 # ** changing the value of a DEFCONSTANT used in another file
54 # ** changing the layout of a structure used in another file
55 # ** changing the PROCLAIMed type of something used in another
56 # file
57 # Mostly it looks as though such limitations aren't fixable without
58 # the aforementioned rearchitecting or solving the halting problem.
60 # To make this work, you need an after-xc.core file. To cause the
61 # system to generate an after-xc.core file, you need
62 # :SB-AFTER-XC-CORE in target features during an ordinary build.
63 # See the comments in base-target-features.lisp-expr for the
64 # recommended way to make that happen.
65 #######################################################################
67 warm_option=""
68 if [ "$1" == --load -o "$1" == --load-with-sb-devel ]; then
69 warm_option="$1"
70 shift
73 # Load our build configuration
74 . output/build-config
76 HOST_TYPE="${1:-sbcl}"
78 echo //HOST_TYPE=\"$HOST_TYPE\"
80 # We don't try to be general about this in this script the way we are
81 # in make.sh, since the idiosyncrasies of SBCL command line argument
82 # order dependence, the meaninglessness of duplicate --core arguments,
83 # and the SBCL-vs-CMUCL dependence of --core/-core argument syntax
84 # make it too messy to try deal with arbitrary SBCL_XC_HOST variants.
85 # So you have no choice:
86 case "$HOST_TYPE" in
87 cmucl) LISP="lisp -batch"
88 INIT="-noinit"
89 CORE="-core"
91 sbcl) LISP="${SBCL_XC_HOST%% *}"
92 INIT="--no-sysinit --no-userinit"
93 CORE="--core"
95 clisp) LISP="clisp"
96 INIT="-norc"
97 CORE="-M"
99 openmcl)
100 LISP="openmcl"
101 INIT="-b"
102 CORE="-I"
104 *) echo unknown host type: "$HOST_TYPE"
105 echo should be one of "sbcl", "cmucl", or "clisp"
106 exit 1
107 esac
109 SBCL_XC_HOST="$LISP ${XC_CORE:+$CORE $XC_CORE} $INIT"
110 export SBCL_XC_HOST
112 # (We don't do make-host-1.sh at all. Hopefully nothing relevant has
113 # changed.)
115 . ./find-gnumake.sh
116 find_gnumake
118 $GNUMAKE -C src/runtime all
120 # Instead of doing the full make-host-2.sh, we (1) use after-xc.core
121 # to rebuild only obviously-out-of-date Lisp files, then (2) run
122 # GENESIS.
123 $LISP $CORE output/after-xc.core $INIT <<'EOF'
124 (load "src/cold/slam.lisp")
126 # (This ^ used to be
127 # for f in $*; do echo "(target-compile-stem \"$f\")"; done \
128 # | sbcl --core output/after-xc.core || exit 1
129 # and perhaps we do something like this again, allowing explicit
130 # rebuild-this-stem requests on the command line to supplement
131 # the rebuild-obviously-outdated-stems logic above.)
133 sh make-genesis-2.sh
135 sh make-target-2.sh "$warm_option"
137 echo //ordinary termination of slam.sh
138 date