added functions for rules requiring all prereqs to be newer to get rebuild.
This commit is contained in:
parent
8cc73cb7ea
commit
7a6e3585c8
22
SYNTAX
22
SYNTAX
|
@ -3,12 +3,18 @@ MAKEFILE:
|
|||
|
||||
<makefile> ::= '(' + "makefile" + <makerule-clause>* + ')'
|
||||
|
||||
<makerule-clause> ::= <rule-clause>
|
||||
<makerule-clause> ::= <file-clause>
|
||||
| <all-clause>
|
||||
| <md5-clause>
|
||||
| <always-clause>
|
||||
| <once-clause>
|
||||
|
||||
<rule-clause> ::= '(' + <rule-clause-identifier>
|
||||
<file-clause> ::= '(' + <fille-clause-identifier>
|
||||
+ <target-spec>
|
||||
+ <prereq-spec>
|
||||
+ <action>+ + ')'
|
||||
|
||||
<all-clause> ::= '(' + <all-clause-identifier>
|
||||
+ <target-spec>
|
||||
+ <prereq-spec>
|
||||
+ <action>+ + ')'
|
||||
|
@ -28,21 +34,25 @@ MAKEFILE:
|
|||
+ <prereq-spec>
|
||||
+ <action-spec> + ')'
|
||||
|
||||
<rule-clause-identifier> ::= "rule"
|
||||
<file-clause-identifier> ::= "file"
|
||||
| "makefile-rule"
|
||||
| "is-out-of-date?"
|
||||
|
||||
<all-clause-identifier> ::= "all"
|
||||
| "file-all"
|
||||
| "all-out-of-date?"
|
||||
|
||||
<md5-clause-identifier> ::= "md5"
|
||||
| "rule-md5"
|
||||
| "file-md5"
|
||||
| "fp-changed?"
|
||||
|
||||
<always-clause-identifier> ::= "always"
|
||||
| "rule-always"
|
||||
| "file-always"
|
||||
| "phony"
|
||||
| "is-out-of-date!"
|
||||
|
||||
<once-clause-identifier> ::= "once"
|
||||
| "rule-once"
|
||||
| "file-once"
|
||||
|
||||
<target-spec> ::= <target> | <target-list>
|
||||
<target> ::= <filename>
|
||||
|
|
|
@ -12,6 +12,18 @@
|
|||
(bind-fluids-gnu target prereqs prereqs-results thunk))
|
||||
cooked-state))))
|
||||
|
||||
(define (make-all-build-func target prereqs thunk)
|
||||
(lambda args
|
||||
; (breakpoint "make-file-build-func")
|
||||
(let ((cooked-state (last args))
|
||||
(prereqs-results (cdr (reverse (cdr args)))))
|
||||
(cons (begin
|
||||
(display ";;; all : ")
|
||||
(display target)
|
||||
(newline)
|
||||
(bind-fluids-gnu target prereqs prereqs-results thunk))
|
||||
cooked-state))))
|
||||
|
||||
(define (make-md5-build-func target prereqs thunk)
|
||||
(lambda args
|
||||
; (breakpoint "make-md5-build-func")
|
||||
|
@ -79,6 +91,26 @@
|
|||
(else (for-each-prereq (car todo) (cdr todo))))))))
|
||||
init-state))))
|
||||
|
||||
(define (make-all-out-of-date? target . prereqs)
|
||||
(lambda args
|
||||
; (breakpoint "make-is-out-of-date?")
|
||||
(let ((init-state (last args)))
|
||||
(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)
|
||||
(error "nonexistent prerequisite" prereq))
|
||||
((and (null? todo)
|
||||
(> (file-last-mod prereq) target-mtime)) #t)
|
||||
(else (and (> (file-last-mod prereq) target-mtime)
|
||||
(for-each-prereq (car todo) (cdr todo)))))))))
|
||||
init-state))))
|
||||
|
||||
(define (make-md5-sum-changed? target . prereqs)
|
||||
(lambda args
|
||||
; (breakpoint "make-md5-sum-changed?")
|
||||
|
|
Loading…
Reference in New Issue