diff --git a/make-rule.scm b/make-rule.scm index 0ac0615..655a731 100644 --- a/make-rule.scm +++ b/make-rule.scm @@ -123,15 +123,15 @@ (let ((build-required? (car wants-build?-result)) (cooked-state (cdr wants-build?-result))) (if build-required? - (if (null? prereqs-results) - (make-rule-result wants-build?-result - ((rule-build-func rule) - build-required? cooked-state)) - (make-rule-result wants-build?-result - (apply (rule-build-func rule) - (append (list build-required?) - prereqs-results - (list cooked-state))))) + (let* ((build-func (rule-build-func rule)) + (build-func-result (if (null? prereqs-results) + (build-func build-required? cooked-state) + (apply build-func + (append (list build-required?) + prereqs-results + (list cooked-state))))) + (end-state (cdr build-func-result))) + (make-rule-result wants-build?-result build-func-result)) (make-rule-result wants-build?-result #f)))))) (define (rule-node/make-links rule connect-ch rule-set)