3 # a quick and dirty way of partially rebuilding the system after a
6 # ("smooth duct tape: the mark of a true craftsman":-)
8 # This software is part of the SBCL system. See the README file for
11 # This software is derived from the CMU CL system, which was
12 # written at Carnegie Mellon University and released into the
13 # public domain. The software is in the public domain and is
14 # provided with absolutely no warranty. See the COPYING and CREDITS
15 # files for more information.
17 #######################################################################
18 # You probably don't want to be using this script unless you
19 # understand the ordinary system build process pretty well already.
21 # This script is not a reliable way to build the system, but it is
22 # fast.:-| It can be useful if you are trying to debug a low-level
23 # problem, e.g. a problem in src/runtime/*.c or in
24 # src/code/cold-init.lisp. Soon, you'll find yourself wanting to
25 # test a small change in a file compiled into cold-sbcl.core without
26 # redoing the entire rebuild-the-system-from-scratch process. You may be
27 # able to avoid a complete make-host-2.sh by just letting this script
28 # rebuild only files that have changed. On the other hand, it might
31 # It's not anywhere rigorously correct for all small changes, much
32 # less for all large changes. It can't be, unless we either solve the
33 # halting problem or totally rearchitect the SBCL sources to support
34 # incremental recompilation. Beyond that fundamental limitation, even
35 # an easy special case might not work unless someone's paid attention
36 # to making it work. Here are some highlights to help you understand
38 # * It will rebuild a .fasl file when the corresponding
39 # .lisp file is out of date.
40 # * It rebuilds the src/runtime/ files completely, since that
41 # doesn't take very long anyway.
42 # * Apparently it will not rebuild assembly-code-in-.lisp files
43 # even when the sources are out of date. This is probably not a
44 # fundamental limitation, it's just that I (WHN 2002-01-16)
45 # have made vanishingly nontrivial changes to assembler files,
46 # so I'm not motivated. If you're motivated, please send a patch.
47 # * It will not notice when you change something in one .lisp file
48 # which should affect the compilation of code in another .lisp
50 # ** changing the definition of a macro used in another file (or a
51 # function or a variable which is used at macroexpansion time)
52 # ** changing the value of a DEFCONSTANT used in another file
53 # ** changing the layout of a structure used in another file
54 # ** changing the PROCLAIMed type of something used in another
56 # Mostly it looks as though such limitations aren't fixable without
57 # the aforementioned rearchitecting or solving the halting problem.
59 # To make this work, you need an after-xc.core file. To cause the
60 # system to generate an after-xc.core file, you need
61 # :SB-AFTER-XC-CORE in target features during an ordinary build.
62 # See the comments in base-target-features.lisp-expr for the
63 # recommended way to make that happen.
64 #######################################################################
66 HOST_TYPE="${1:-sbcl}"
68 echo //HOST_TYPE=\"$HOST_TYPE\"
70 # We don't try to be general about this in this script the way we are
71 # in make.sh, since the idiosyncrasies of SBCL command line argument
72 # order dependence, the meaninglessness of duplicate --core arguments,
73 # and the SBCL-vs-CMUCL dependence of --core/-core argument syntax
74 # make it too messy to try deal with arbitrary SBCL_XC_HOST variants.
75 # So you have no choice:
77 cmucl) LISP="lisp -batch"
82 INIT="--sysinit /dev/null --userinit /dev/null"
94 *) echo unknown host type: "$HOST_TYPE"
95 echo should be one of "sbcl", "cmucl", or "clisp"
99 SBCL_XC_HOST="$LISP $INIT"
102 # (We don't do make-host-1.sh at all. Hopefully nothing relevant has
108 sh make-target-1.sh || exit 1
110 # Instead of doing the full make-host-2.sh, we (1) use after-xc.core
111 # to rebuild only obviously-out-of-date Lisp files, then (2) run
113 $LISP $CORE output/after-xc.core $INIT <<'EOF' || exit 1
114 (load "src/cold/slam.lisp")
117 # for f in $*; do echo "(target-compile-stem \"$f\")"; done \
118 # | sbcl --core output/after-xc.core || exit 1
119 # and perhaps we do something like this again, allowing explicit
120 # rebuild-this-stem requests on the command line to supplement
121 # the rebuild-obviously-outdated-stems logic above.)
123 sh make-genesis-2.sh || exit 1
125 sh make-target-2.sh || exit 1
127 echo //ordinary termination of slam.sh