1 ! Copyright (C) 2008, 2009 Eduardo Cavazos, Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors arrays calendar combinators.short-circuit fry
4 continuations debugger io.directories io.files io.launcher
5 io.pathnames io.encodings.ascii kernel make mason.common mason.config
6 mason.platform mason.report mason.notify namespaces sequences
10 : make-cmd ( -- args )
11 gnu-make platform 2array ;
17 "../compile-log" >>stdout
22 : builds-factor-image ( -- img )
23 builds/factor boot-image-name append-path ;
26 builds-factor-image "." copy-file-into
27 builds-factor-image "factor" copy-file-into ;
29 : factor-vm ( -- string )
30 target-os get "winnt" = "./factor.com" "./factor" ? ;
34 "-i=" boot-image-name append
43 "../boot-log" >>stdout
49 : test-cmd ( -- cmd ) factor-vm "-run=mason.test" 2array ;
56 "../test-log" >>stdout
62 : recover-else ( try catch else -- )
63 [ [ '[ @ f t ] ] [ '[ @ f ] ] bi* recover ] dip '[ drop @ ] when ; inline
65 MACRO: recover-cond ( alist -- )
66 dup { [ length 1 = ] [ first callable? ] } 1&&
67 [ first ] [ [ first first2 ] [ rest ] bi '[ _ _ [ _ recover-cond ] recover-else ] ] if ;
69 : build-child ( -- status )
72 { [ notify-make-vm make-vm ] [ compile-failed ] }
73 { [ notify-boot boot ] [ boot-failed ] }
74 { [ notify-test test ] [ test-failed ] }