((synopsis "A compiler and runtime system for R5RS Scheme on top of JavaScript") (license "BSD") (category web) (version "0.09") (test-dependencies) (build-dependencies jsmin make) (runtime-dependencies matchable) (authors "felix winkelmann") (components (extension spock-compiler (dependencies "misc.scm" "expand.scm" "core.scm" "opt.scm" "xref.scm" "sections.scm" "spock/library.scm" "driver.scm" "codegen.scm") (csc-options -sS -O3 -d1)) (program chicken-spock (dependencies spock-compiler "chicken-spock.scm" "top.scm") (csc-options -S -O3 -d0 -feature standalone)) (extension spock (dependencies spock-compiler) (source-file "spock-module.scm") (csc-options -sS -O3 -d1)) (custom spock-runtime (dependencies chicken-spock "config.js" "runtime.js" "debug.js" "spock/library.scm") ;; This procedure could also be a definition in spock.setup ;; which would be loaded before the build process starts (build (lambda (self dependencies) (use utils jsmin make) (define (cat out . files) (print " cat " (string-intersperse files) " > " out) (with-output-to-file out (lambda () (for-each (lambda (f) (display (read-all f))) files)))) (define (jsmin from to) (with-output-to-file to (cut display (jsmin-file from)))) (define executable (alist-ref 'chicken-spock (alist-ref 'programs dependencies))) (define results '("spock/spock-runtime.js" "spock/spock-runtime-debug.js" "spock/spock-runtime-min.js" "spock/spock-runtime-debug-min.js")) (make/proc (list (list "spock/spock-runtime.js" '("config.js" "runtime.js" "library.js") (lambda () (cat "spock/spock-runtime.js" "config.js" "runtime.js" "library.js"))) (list "spock/spock-runtime-debug.js" '("config.js" "runtime.js" "debug.js" "library-debug.js") (lambda () (cat "spock/spock-runtime-debug.js" "config.js" "runtime.js" "debug.js" "library-debug.js"))) (list "spock/spock-runtime-min.js" '("spock/spock-runtime.js") (lambda () (jsmin "spock/spock-runtime.js" "spock/spock-runtime-min.js"))) (list "spock/spock-runtime-debug-min.js" '("spock/spock-runtime-debug.js") (lambda () (jsmin "spock/spock-runtime-debug.js" "spock/spock-runtime-debug-min.js"))) (list "library.js" (list "spock/library.scm" executable) (lambda () (run (./chicken-spock -library-path spock -optimize -library -o library.js)))) (list "library-debug.js" (list "spock/library.scm" executable) (lambda () (run (./chicken-spock -library-path spock -optimize -debug -library -o library-debug.js))))) results) results)))))