. etc/functions.sh
-run_cmd_in_dir runtime ../microcode/scheme --library ../lib --heap 6000 \
- --band runtime.com --batch-mode <<EOF
+if [ ! -e lib/runtime.com ]; then
+ FASL=`get_fasl_file`
+ run_cmd_in_dir runtime \
+ ../microcode/scheme --batch-mode --library ../lib --fasl $FASL <<EOF
+(disk-save "../lib/runtime.com")
+EOF
+fi
+
+run_cmd ./microcode/scheme --batch-mode --library lib --band runtime.com <<EOF
(begin
(load-option (quote compiler))
(load-option (quote edwin))
- (disk-save "../lib/all.com"))
+ (disk-save "lib/all.com"))
EOF
exit 1
fi
-run_cmd "${EXE}" --band runtime.com --heap 6000 --stack 200 <<EOF
+run_cmd "${EXE}" --batch-mode --library lib --band x-compiler.com <<EOF
(begin
(load "etc/compile.scm")
- (c-prepare))
+ (in-liarc
+ (lambda ()
+ (compile-boot-dirs c-compile-dir))))
EOF
+
+# distclean will not get these...
+run_cmd ./Stage.sh remove X
exit 1
fi
-run_cmd "${EXE}" --band runtime.com --heap 6000 <<EOF
-(begin
- (load "etc/compile.scm")
- (compile-bootstrap-1))
+run_cmd "${EXE}" --batch-mode <<EOF
+(load "etc/compile.scm")
+(compile-cref compile-dir)
+(for-each compile-dir '("runtime" "star-parser" "sf"))
EOF
-run_cmd "${EXE}" --band all.com --heap 6000 <<EOF
-(begin
- (load "etc/compile.scm")
- (compile-bootstrap-2))
+FASL=`get_fasl_file`
+run_cmd_in_dir runtime "${EXE}" --batch-mode --library ../lib --fasl $FASL <<EOF
+(disk-save "../lib/x-runtime.com")
EOF
+echo ""
+
+run_cmd "${EXE}" --batch-mode --library lib --band x-runtime.com <<EOF
+(load-option 'SF)
+(with-working-directory-pathname "compiler"
+ (lambda ()
+ (load "compiler.sf")))
+EOF
+
+run_cmd "${EXE}" --batch-mode <<EOF
+(with-working-directory-pathname "compiler"
+ (lambda ()
+ (load "compiler.cbf")))
+EOF
+
+run_cmd "${EXE}" --batch-mode --library lib --band x-runtime.com <<EOF
+(load-option 'SF)
+(load-option 'CREF)
+(load-option '*PARSER)
+(load-option 'COMPILER)
+(disk-save "lib/x-compiler.com")
+EOF
+
+# Remove host (native) code to STAGEX/ subdirs.
+run_cmd ./Stage.sh make X