(use posix) (define *version* "0.2") (define (newer file1 file2) (or (not (get-environment-variable "FAST_BUILD")) (not (file-exists? file2)) (> (file-modification-time file1) (file-modification-time file2)))) (define (build-module name) (let ((source-file (string-append name ".scm")) (so-file (string-append name ".so")) (import-file (string-append name ".import.scm")) (import-so-file (string-append name ".import.so")) (o-file (string-append name ".o"))) (when (newer source-file so-file) (compile -s -optimize-level 3 -debug-level 2 ,(string->symbol source-file) -j ,(string->symbol name)) (compile -s -optimize-level 3 -debug-level 2 ,(string->symbol import-file)) (compile -c -optimize-level 3 -debug-level 2 ,(string->symbol source-file) -unit ,(string->symbol name))) (install-extension (string->symbol name) `(,so-file ,o-file ,import-so-file) `((version ,*version*) (static o-file))))) (define (build-program name) (let ((source-file (string-append name ".scm")) (exec-file name)) (when (newer source-file exec-file) (compile -optimize-level 3 -debug-level 2 ,(string->symbol source-file))) (install-program (string->symbol name) exec-file `((version ,*version*))))) (build-module "bokbok-packet") (build-module "bokbok") (build-program "bokbok-demo")