keep a root file named after a CHICKEN module out of the graph
Only the eggs were told apart from the modules, so a scheme.scm became the scheme every unit imports, a dependency of every object and of itself, and the build went on to link it.
This commit is contained in:
@@ -23,6 +23,7 @@
|
|||||||
(import scheme
|
(import scheme
|
||||||
(chicken base)
|
(chicken base)
|
||||||
(chicken condition)
|
(chicken condition)
|
||||||
|
(chicken eval)
|
||||||
(chicken file)
|
(chicken file)
|
||||||
(chicken io)
|
(chicken io)
|
||||||
(chicken pathname)
|
(chicken pathname)
|
||||||
@@ -43,11 +44,22 @@
|
|||||||
;;; module the tests import
|
;;; module the tests import
|
||||||
(define eggs (call-with-input-file "dependencies.txt" read-list))
|
(define eggs (call-with-input-file "dependencies.txt" read-list))
|
||||||
|
|
||||||
|
;;; A scheme.scm is not the module every unit imports. Asked from /,
|
||||||
|
;;; since here a NAME.import.scm built from NAME.scm would answer
|
||||||
|
(define (chicken-module? name)
|
||||||
|
(let ((here (current-directory)))
|
||||||
|
(dynamic-wind
|
||||||
|
(lambda () (change-directory "/"))
|
||||||
|
(lambda () (handle-exceptions exn #f (module-environment name) #t))
|
||||||
|
(lambda () (change-directory here)))))
|
||||||
|
|
||||||
(define (module-file name)
|
(define (module-file name)
|
||||||
(and (symbol? name)
|
(and (symbol? name)
|
||||||
(not (memq name eggs))
|
(not (memq name eggs))
|
||||||
(let ((file (string-append (symbol->string name) ".scm")))
|
(let ((file (string-append (symbol->string name) ".scm")))
|
||||||
(and (file-exists? file) file))))
|
(and (file-exists? file)
|
||||||
|
(not (chicken-module? name))
|
||||||
|
file))))
|
||||||
|
|
||||||
;;; FILE's forms, or the end of the scan, naming the file that has none
|
;;; FILE's forms, or the end of the scan, naming the file that has none
|
||||||
(define (forms-of file)
|
(define (forms-of file)
|
||||||
|
|||||||
Reference in New Issue
Block a user