#!/bin/sh
#
-# $Id: Clean.sh,v 1.14 2007/05/03 03:40:02 cph Exp $
+# $Id: Clean.sh,v 1.15 2007/05/06 14:16:44 cph Exp $
#
# Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
# 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
. etc/functions.sh
-maybe_rm boot-compiler.com
+maybe_rm c-boot-compiler.com native-boot-compiler.com
if [ ${FULL} = yes ]; then
maybe_rm lib/*.com
-# $Id: Makefile.in,v 1.34 2007/05/04 01:27:30 cph Exp $
+# $Id: Makefile.in,v 1.35 2007/05/06 14:16:49 cph Exp $
#
# Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
# 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
all:
( cd microcode && $(MAKE) all )
- $(srcdir)/etc/$(COMPILE_SCRIPT) $(srcdir)
+ $(srcdir)/etc/$(COMPILE_SCRIPT)
( cd microcode && $(MAKE) liarc-bundles )
$(srcdir)/etc/build-bands.sh
-c: boot-compiler.com
+c: c-boot-compiler.com
$(srcdir)/etc/c-prepare.sh
-rm -f liarc.stamp
echo "done" > liarc.stamp
-boot-compiler.com:
- $(srcdir)/etc/c-boot-compiler.sh
+native: native-boot-compiler.com
+ $(srcdir)/etc/compile.sh mit-scheme-c --band native-boot-compiler.com
+
+c-boot-compiler.com:
+ $(srcdir)/etc/c-boot-compiler.sh mit-scheme c-boot-compiler
+
+native-boot-compiler.com:
+ $(srcdir)/etc/c-boot-compiler.sh mit-scheme-c native-boot-compiler
mostlyclean clean distclean maintainer-clean c-clean:
$(srcdir)/Clean.sh $@ $(SUBDIRS)
#!/bin/sh
#
-# $Id: c-boot-compiler.sh,v 1.4 2007/05/03 03:45:51 cph Exp $
+# $Id: c-boot-compiler.sh,v 1.5 2007/05/06 14:16:54 cph Exp $
#
# Copyright 2007 Massachusetts Institute of Technology
#
#
# You should have received a copy of the GNU General Public License
# along with MIT/GNU Scheme; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+# 02110-1301, USA.
set -e
-if [ -z "${SCHEME_LARGE}" ]; then
- SCHEME_LARGE="mit-scheme --heap 6000"
+if [ ${#} -eq 2 ]; then
+ EXE=${1}
+ OUT=${2}
+else
+ echo "usage: ${0} <executable> <output-file>"
+ exit 1
fi
+CMD="${EXE} --heap 6000"
-if [ -z "${SCHEME_COMPILER}" ]; then
- SCHEME_COMPILER="${SCHEME_LARGE} --compiler"
-fi
-
-# Step 1: Compile CREF and SF natively, so that we can load them
-# independently of the compiler. (There is no standard band that
-# loads them independently.)
-
-echo "${SCHEME_COMPILER}"
-${SCHEME_COMPILER} <<EOF
-(begin
- (load "etc/compile.scm")
- (compile-bootstrap-1))
-EOF
-
-# Step 2: Load CREF and SF, and syntax the compiler configured with
+# Step 1: Load CREF and SF, and syntax the compiler configured with
# the C back end.
-echo "${SCHEME_LARGE}"
-${SCHEME_LARGE} <<EOF
+echo "${CMD}"
+${CMD} <<EOF
(begin
(load "etc/compile.scm")
- (compile-bootstrap-2))
+ (compile-bootstrap-1))
EOF
-# Step 3: Now that the compiler with the C back end is syntaxed and
+# Step 2: Now that the compiler with the C back end is syntaxed and
# packaged, use the native compiler to compile the bootstrap C
# compiler natively.
-echo "${SCHEME_COMPILER}"
-${SCHEME_COMPILER} <<EOF
+echo "${CMD} --compiler"
+${CMD} --compiler <<EOF
(begin
(load "etc/compile.scm")
- (compile-bootstrap-3))
+ (compile-bootstrap-2))
EOF
-# Step 4: Load up the natively compiled compiler with the C back end,
+# Step 3: Load up the natively compiled compiler with the C back end,
# and save a band.
-echo "${SCHEME_LARGE}"
-${SCHEME_LARGE} <<EOF
+echo "${CMD}"
+${CMD} <<EOF
(begin
(load "etc/compile.scm")
- (compile-bootstrap-4)
- (disk-save "boot-compiler.com"))
+ (compile-bootstrap-3)
+ (disk-save "${OUT}.com"))
EOF
#!/bin/sh
#
-# $Id: c-compile.sh,v 1.5 2007/05/04 19:34:03 cph Exp $
+# $Id: c-compile.sh,v 1.6 2007/05/06 14:16:59 cph Exp $
#
# Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
# 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
set -e
-if [ ${#} -ge 1 ]; then
- echo "cd ${1}"
- cd "${1}"
-elif [ -r etc/compile.scm ]; then
- :
-else
- echo "usage: ${0} DIRECTORY"
- exit 1
-fi
-
etc/build-runtime.sh
echo "microcode/scheme --library lib --heap 6000 --stack 200"
#!/bin/sh
#
-# $Id: c-prepare.sh,v 1.4 2007/05/04 19:35:37 cph Exp $
+# $Id: c-prepare.sh,v 1.5 2007/05/06 14:17:14 cph Exp $
#
# Copyright 2007 Massachusetts Institute of Technology
#
set -e
-if [ ${#} -ge 1 ]; then
- cd "${1}"
-elif [ -r etc/compile.scm ]; then
- :
-else
- echo "usage: ${0} DIRECTORY"
- exit 1
-fi
-
if [ -z "${SCHEME_LARGE}" ]; then
SCHEME_LARGE="mit-scheme --heap 6000"
fi
-${SCHEME_LARGE} --band boot-compiler.com <<EOF
+${SCHEME_LARGE} --band c-boot-compiler.com <<EOF
(begin
(load "etc/compile.scm")
(c-prepare))
#| -*-Scheme-*-
-$Id: compile.scm,v 1.17 2007/05/04 01:26:59 cph Exp $
+$Id: compile.scm,v 1.18 2007/05/06 14:17:04 cph Exp $
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
(define (compile-boot-dirs compile-dir)
(compile-cref compile-dir)
- (for-each compile-dir '("runtime" "sf" "compiler" "star-parser")))
+ (for-each compile-dir '("runtime" "cref" "sf" "compiler" "star-parser")))
(define (compile-cref compile-dir)
(compile-dir "cref")
(load "load"))))))
\f
(define (compile-bootstrap-1)
- (compile-cref compile-dir)
- (compile-dir "sf"))
-
-(define (compile-bootstrap-2)
- (load-dir "cref")
- (load-dir "sf")
+ (load-option 'SF)
(with-working-directory-pathname "compiler"
(lambda ()
(load "compiler.sf"))))
-(define (compile-bootstrap-3)
- (with-working-directory-pathname "compiler"
- (lambda ()
- (load "compiler.cbf"))))
+(define (compile-bootstrap-2)
+ (if (eq? microcode-id/compiled-code-type 'C)
+ (fluid-let ((compiler:invoke-c-compiler? #f))
+ (with-working-directory-pathname "compiler"
+ (lambda ()
+ (load "compiler.cbf")))
+ (c-compile-pkgs "compiler"))
+ (with-working-directory-pathname "compiler"
+ (lambda ()
+ (load "compiler.cbf")))))
-(define (compile-bootstrap-4)
- (load-dir "cref")
- (load-dir "sf")
+(define (compile-bootstrap-3)
+ (load-option 'SF)
(load-dir "compiler"))
(define (c-prepare)
#!/bin/sh
#
-# $Id: compile.sh,v 1.11 2007/05/03 03:45:52 cph Exp $
+# $Id: compile.sh,v 1.12 2007/05/06 14:17:10 cph Exp $
#
# Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
# 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
set -e
-if [ ${#} -ge 1 ]; then
- echo "cd ${1}"
- cd "${1}"
-elif [ -r etc/compile.scm ]; then
- :
+if [ ${#} -eq 0 ]; then
+ SCHEME_COMPILER="mit-scheme --compiler"
else
- echo "usage: ${0} DIRECTORY"
- exit 1
+ SCHEME_COMPILER=${1}
+ shift
+ while [ ${#} -gt 0 ]; do
+ SCHEME_COMPILER="${SCHEME_COMPILER} ${1}"
+ shift
+ done
fi
-if [ -z "${SCHEME_COMPILER}" ]; then
- SCHEME_COMPILER="mit-scheme --compiler --heap 6000 --stack 200"
-fi
+SCHEME_COMPILER="${SCHEME_COMPILER} --heap 6000 --stack 200"
echo "${SCHEME_COMPILER}"
exec ${SCHEME_COMPILER} <<EOF