make-is-out-of-date? is more readable now; small improvement
target-mtime doesn't need to be checked for each prereq.
This commit is contained in:
parent
9e1b812cfd
commit
c411f67a2c
|
@ -6,7 +6,7 @@
|
|||
(let ((cooked-state (last args))
|
||||
(prereqs-results (cdr (reverse (cdr args)))))
|
||||
(cons (begin
|
||||
(display ";;; rule : ")
|
||||
(display ";;; file : ")
|
||||
(display target)
|
||||
(newline)
|
||||
(bind-fluids-gnu target prereqs prereqs-results thunk))
|
||||
|
@ -64,15 +64,19 @@
|
|||
(lambda args
|
||||
; (breakpoint "make-is-out-of-date?")
|
||||
(let ((init-state (last args)))
|
||||
(cons (or (file-not-exists? target)
|
||||
(and (not (null? prereqs))
|
||||
(cons (if (file-not-exists? target)
|
||||
#t
|
||||
(if (null? prereqs)
|
||||
#f
|
||||
(let ((target-mtime (file-last-mod target)))
|
||||
(let for-each-prereq ((prereq (car prereqs))
|
||||
(todo (cdr prereqs)))
|
||||
(cond
|
||||
((file-not-exists? prereq) #t)
|
||||
((> (file-last-mod prereq) (file-last-mod target)) #t)
|
||||
((file-not-exists? prereq)
|
||||
(error "nonexistent prerequisite" prereq))
|
||||
((> (file-last-mod prereq) target-mtime) #t)
|
||||
((null? todo) #f)
|
||||
(else (for-each-prereq (car todo) (cdr todo)))))))
|
||||
(else (for-each-prereq (car todo) (cdr todo))))))))
|
||||
init-state))))
|
||||
|
||||
(define (make-md5-sum-changed? target . prereqs)
|
||||
|
|
Loading…
Reference in New Issue