Ticket #947: phony.diff

File phony.diff, 2.2 KB (added by Mario Domenech Goulart, 11 years ago)

Fixed patch

  • make.scm

     
    4040#f.
    4141
    4242> (make-print-reasons [on?]) If #t, make prints the reason for each
    43 dependancy that fires. Defaultly #t.
     43dependency that fires. Defaultly #t.
    4444|#
    4545
    4646(require-library srfi-1 posix)
    4747
    4848(module make (make make/proc make-print-checking
    4949                   make-print-dep-no-line
    50                    make-print-reasons)
     50                   make-print-reasons
     51                   make-nonfile-targets)
    5152 
    5253(import scheme chicken extras posix srfi-1)
    5354
    5455(define make-print-checking (make-parameter #f))
    5556(define make-print-dep-no-line (make-parameter #f))
    5657(define make-print-reasons (make-parameter #f))
     58(define make-nonfile-targets (make-parameter '()))
    5759
    5860(define (make:find-matching-line str spec)
    5961  (let ((match? (lambda (s) (string=? s str))))
     
    130132                      (let ((reason
    131133                             (or (not date)
    132134                                 (find (lambda (dep)
    133                                          (unless (file-exists? dep)
    134                                            (error (sprintf "dependancy ~a was not made~%" dep)))
    135                                          (and (> (file-modification-time dep) date)
    136                                               dep))
     135                                         (and (not (member dep (make-nonfile-targets)))
     136                                              (unless (file-exists? dep)
     137                                                (error (sprintf "dependency ~a was not made~%" dep)))
     138                                              (and (> (file-modification-time dep) date)
     139                                                   dep)))
    137140                                       deps))))
    138141                        (when reason
    139142                          (let ((l (cddr line)))
     
    145148                               s
    146149                               (if (make-print-reasons)
    147150                                   (cond
    148                                     ((not date)
     151                                    ((and (not date) (not (member s (make-nonfile-targets))))
    149152                                     (string-append " because " s " does not exist"))
    150153                                    ((string? reason)
    151154                                     (string-append " because " reason " changed"))