(use posix) (define *version* "2.0") (define (newer file1 file2) (or (not (get-environment-variable "UGARIT_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 "directory-rules") (build-module "ugarit-mime") (build-module "ugarit-backend") (build-module "ugarit-core") (build-module "ugarit-streams") (build-module "ugarit-files") (build-module "ugarit-snapshot") (build-module "ugarit-archive") (build-module "ugarit-vfs") (build-module "ugarit-api") (build-program "backend-fs") (build-program "backend-sqlite") (build-program "backend-cache") (build-program "backend-log") (build-program "ugarit") (build-program "ugarit-storage-admin")