Reusable Version of Jscheme Shell Script

;; JScheme version
(load "ll2.scm") ;; provide same support as Ruby example in 70 lines
(define (compile dir)
   (for-each  (lambda(c) 
                   (display {compiling [c] to [(c->o c)].\n})
                   (run gcc -c -o  ,(c->o c) ,c))
               (files** dir needsUpdate?)))

(define isCFile? (// "\\.c$"))   
(define c->o (/// "\\.c$" "\\.o")) 
(define (needsUpdate? f) (and (isCFile? f) (needsRecompile f (c->o f))))
(define (needsRecompile f o)
  (or (not (.exists o)) (<= (.lastModified o) (.lastModified f))))


back to top

set preferences

LL2, Saturday 9 November 2002, Tim Hickey/Ken Anderson