#| -*-Scheme-*-
-$Id: toplev.scm,v 4.52 1993/11/29 19:11:24 gjr Exp $
+$Id: toplev.scm,v 4.53 1997/06/12 04:35:47 cph Exp $
-Copyright (c) 1988-1993 Massachusetts Institute of Technology
+Copyright (c) 1988-97 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
(declare (usual-integrations))
\f
-;;;; Usual Entry Point: File Compilation
+;;;; Incremental File Compiler
+
+(define compile-file:override-usual-integrations '())
+(define compile-file:sf-only? #f)
+(define compile-file:force? #f)
+(define compile-file)
+(let ((scm-pathname (lambda (path) (pathname-new-type path "scm")))
+ (bin-pathname (lambda (path) (pathname-new-type path "bin")))
+ (ext-pathname (lambda (path) (pathname-new-type path "ext")))
+ (com-pathname (lambda (path) (pathname-new-type path "com"))))
+
+ (define (process-file input-file output-file dependencies processor)
+ (let ((doit (lambda () (processor input-file output-file dependencies))))
+ (if compile-file:force?
+ (doit)
+ (let ((reasons
+ (let ((output-time (file-modification-time output-file)))
+ (if (not output-time)
+ (list input-file)
+ (list-transform-positive (cons input-file dependencies)
+ (lambda (dependency)
+ (let ((dep-time (file-modification-time dependency)))
+ (if dep-time
+ (> dep-time output-time)
+ (begin
+ (warn "Missing dependency:"
+ (->namestring dependency))
+ #f)))))))))
+ (if (not (null? reasons))
+ (begin
+ (newline)
+ (write-string ";Generating ")
+ (write (->namestring output-file))
+ (write-string " because of:")
+ (for-each (lambda (reason)
+ (write-char #\space)
+ (write (->namestring reason)))
+ reasons)
+ (doit)))))))
+
+ (set! compile-file
+ (named-lambda (compile-file file #!optional dependencies syntax-table)
+ (process-file (scm-pathname file)
+ (bin-pathname file)
+ (map ext-pathname
+ (if (default-object? dependencies)
+ '()
+ dependencies))
+ (lambda (input-file output-file dependencies)
+ (fluid-let ((sf/default-syntax-table
+ (if (default-object? syntax-table)
+ #f
+ syntax-table))
+ (sf/default-declarations
+ `((USUAL-INTEGRATIONS
+ ,@compile-file:override-usual-integrations)
+ ,@(if (null? dependencies)
+ '()
+ `((INTEGRATE-EXTERNAL ,@dependencies))))))
+ (sf input-file output-file))))
+ (if (not compile-file:sf-only?)
+ (process-file (bin-pathname file)
+ (com-pathname file)
+ '()
+ (lambda (input-file output-file dependencies)
+ dependencies
+ (fluid-let ((compiler:coalescing-constant-warnings? #f))
+ (compile-bin-file input-file output-file))))))))
+\f
+;;;; Non-Incremental File Compiler
(define (cf input #!optional output)
(let ((kernel
#| -*-Scheme-*-
-$Id: compiler.pkg,v 1.22 1996/11/10 05:59:09 adams Exp $
+$Id: compiler.pkg,v 1.23 1997/06/12 04:35:59 cph Exp $
-Copyright (c) 1992-1994 Massachusetts Institute of Technology
+Copyright (c) 1992-97 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
cbf
cf
compile-bin-file
+ compile-file
+ compile-file:force?
+ compile-file:override-usual-integrations
+ compile-file:sf-only?
compile-procedure
compile-scode
compiler:reset!
#| -*-Scheme-*-
-$Id: compiler.pkg,v 1.47 1994/01/08 21:18:45 gjr Exp $
+$Id: compiler.pkg,v 1.48 1997/06/12 04:36:08 cph Exp $
-Copyright (c) 1988-1994 Massachusetts Institute of Technology
+Copyright (c) 1988-97 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
cbf
cf
compile-bin-file
+ compile-file
+ compile-file:force?
+ compile-file:override-usual-integrations
+ compile-file:sf-only?
compile-procedure
compile-scode
compiler:dump-bci-file
#| -*-Scheme-*-
-$Id: toplev.scm,v 1.13 1996/07/26 01:01:44 adams Exp $
+$Id: toplev.scm,v 1.14 1997/06/12 04:36:25 cph Exp $
-Copyright (c) 1988-1996 Massachusetts Institute of Technology
+Copyright (c) 1988-97 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
(declare (usual-integrations))
\f
-;;;; Usual Entry Point: File Compilation
+;;;; Incremental File Compiler
+
+(define compile-file:override-usual-integrations '())
+(define compile-file:sf-only? #f)
+(define compile-file:force? #f)
+(define compile-file)
+(let ((scm-pathname (lambda (path) (pathname-new-type path "scm")))
+ (bin-pathname (lambda (path) (pathname-new-type path "bin")))
+ (ext-pathname (lambda (path) (pathname-new-type path "ext")))
+ (com-pathname (lambda (path) (pathname-new-type path "com"))))
+
+ (define (process-file input-file output-file dependencies processor)
+ (let ((doit (lambda () (processor input-file output-file dependencies))))
+ (if compile-file:force?
+ (doit)
+ (let ((reasons
+ (let ((output-time (file-modification-time output-file)))
+ (if (not output-time)
+ (list input-file)
+ (list-transform-positive (cons input-file dependencies)
+ (lambda (dependency)
+ (let ((dep-time (file-modification-time dependency)))
+ (if dep-time
+ (> dep-time output-time)
+ (begin
+ (warn "Missing dependency:"
+ (->namestring dependency))
+ #f)))))))))
+ (if (not (null? reasons))
+ (begin
+ (newline)
+ (write-string ";Generating ")
+ (write (->namestring output-file))
+ (write-string " because of:")
+ (for-each (lambda (reason)
+ (write-char #\space)
+ (write (->namestring reason)))
+ reasons)
+ (doit)))))))
+
+ (set! compile-file
+ (named-lambda (compile-file file #!optional dependencies syntax-table)
+ (process-file (scm-pathname file)
+ (bin-pathname file)
+ (map ext-pathname
+ (if (default-object? dependencies)
+ '()
+ dependencies))
+ (lambda (input-file output-file dependencies)
+ (fluid-let ((sf/default-syntax-table
+ (if (default-object? syntax-table)
+ #f
+ syntax-table))
+ (sf/default-declarations
+ `((USUAL-INTEGRATIONS
+ ,@compile-file:override-usual-integrations)
+ ,@(if (null? dependencies)
+ '()
+ `((INTEGRATE-EXTERNAL ,@dependencies))))))
+ (sf input-file output-file))))
+ (if (not compile-file:sf-only?)
+ (process-file (bin-pathname file)
+ (com-pathname file)
+ '()
+ (lambda (input-file output-file dependencies)
+ dependencies
+ (fluid-let ((compiler:coalescing-constant-warnings? #f))
+ (compile-bin-file input-file output-file))))))))
+\f
+;;;; Non-Incremental File Compiler
(define (cf input #!optional output)
(let ((kernel
#| -*-Scheme-*-
-$Id: compiler.pkg,v 1.3 1995/10/25 19:49:37 ssmith Exp $
+$Id: compiler.pkg,v 1.4 1997/06/12 04:36:20 cph Exp $
-Copyright (c) 1988-1995 Massachusetts Institute of Technology
+Copyright (c) 1988-97 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
cf
compile-bin-file
compile-expression
+ compile-file
+ compile-file:force?
+ compile-file:override-usual-integrations
+ compile-file:sf-only?
compile-procedure
compile-scode
compiler:dump-bci-file
#| -*-Scheme-*-
-$Id: compiler.pkg,v 1.18 1996/07/30 19:29:48 adams Exp $
+$Id: compiler.pkg,v 1.19 1997/06/12 04:36:16 cph Exp $
-Copyright (c) 1988-1995 Massachusetts Institute of Technology
+Copyright (c) 1988-97 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
cf
compile-bin-file
compile-expression
+ compile-file
+ compile-file:force?
+ compile-file:override-usual-integrations
+ compile-file:sf-only?
compile-procedure
compile-scode
compiler:dump-bci-file