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" ? ;
35 "-i=" boot-image-name append ,
37 target-cpu get { "x86.32" "x86.64" } member? [ "-sse-version=30" , ] when
45 "../boot-log" >>stdout
51 : test-cmd ( -- cmd ) factor-vm "-run=mason.test" 2array ;
58 "../test-log" >>stdout
64 : recover-else ( try catch else -- )
65 [ [ '[ @ f t ] ] [ '[ @ f ] ] bi* recover ] dip '[ drop @ ] when ; inline
67 MACRO: recover-cond ( alist -- )
68 dup { [ length 1 = ] [ first callable? ] } 1&&
70 [ first first2 ] [ rest ] bi
71 '[ _ _ [ _ recover-cond ] recover-else ]
74 : build-child ( -- status )
77 { [ notify-make-vm make-vm ] [ compile-failed ] }
78 { [ notify-boot boot ] [ boot-failed ] }
79 { [ notify-test test ] [ test-failed ] }