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>* + ')'
|
<makefile> ::= '(' + "makefile" + <makerule-clause>* + ')'
|
||||||
|
|
||||||
<makerule-clause> ::= <rule-clause>
|
<makerule-clause> ::= <file-clause>
|
||||||
|
| <all-clause>
|
||||||
| <md5-clause>
|
| <md5-clause>
|
||||||
| <always-clause>
|
| <always-clause>
|
||||||
| <once-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>
|
+ <target-spec>
|
||||||
+ <prereq-spec>
|
+ <prereq-spec>
|
||||||
+ <action>+ + ')'
|
+ <action>+ + ')'
|
||||||
|
@ -28,21 +34,25 @@ MAKEFILE:
|
||||||
+ <prereq-spec>
|
+ <prereq-spec>
|
||||||
+ <action-spec> + ')'
|
+ <action-spec> + ')'
|
||||||
|
|
||||||
<rule-clause-identifier> ::= "rule"
|
<file-clause-identifier> ::= "file"
|
||||||
| "makefile-rule"
|
| "makefile-rule"
|
||||||
| "is-out-of-date?"
|
| "is-out-of-date?"
|
||||||
|
|
||||||
|
<all-clause-identifier> ::= "all"
|
||||||
|
| "file-all"
|
||||||
|
| "all-out-of-date?"
|
||||||
|
|
||||||
<md5-clause-identifier> ::= "md5"
|
<md5-clause-identifier> ::= "md5"
|
||||||
| "rule-md5"
|
| "file-md5"
|
||||||
| "fp-changed?"
|
| "fp-changed?"
|
||||||
|
|
||||||
<always-clause-identifier> ::= "always"
|
<always-clause-identifier> ::= "always"
|
||||||
| "rule-always"
|
| "file-always"
|
||||||
| "phony"
|
| "phony"
|
||||||
| "is-out-of-date!"
|
| "is-out-of-date!"
|
||||||
|
|
||||||
<once-clause-identifier> ::= "once"
|
<once-clause-identifier> ::= "once"
|
||||||
| "rule-once"
|
| "file-once"
|
||||||
|
|
||||||
<target-spec> ::= <target> | <target-list>
|
<target-spec> ::= <target> | <target-list>
|
||||||
<target> ::= <filename>
|
<target> ::= <filename>
|
||||||
|
|
|
@ -12,6 +12,18 @@
|
||||||
(bind-fluids-gnu target prereqs prereqs-results thunk))
|
(bind-fluids-gnu target prereqs prereqs-results thunk))
|
||||||
cooked-state))))
|
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)
|
(define (make-md5-build-func target prereqs thunk)
|
||||||
(lambda args
|
(lambda args
|
||||||
; (breakpoint "make-md5-build-func")
|
; (breakpoint "make-md5-build-func")
|
||||||
|
@ -79,6 +91,26 @@
|
||||||
(else (for-each-prereq (car todo) (cdr todo))))))))
|
(else (for-each-prereq (car todo) (cdr todo))))))))
|
||||||
init-state))))
|
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)
|
(define (make-md5-sum-changed? target . prereqs)
|
||||||
(lambda args
|
(lambda args
|
||||||
; (breakpoint "make-md5-sum-changed?")
|
; (breakpoint "make-md5-sum-changed?")
|
||||||
|
|
Loading…
Reference in New Issue