1 ! Copyright (C) 2008, 2011 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
6 mason.config mason.platform mason.report mason.notify namespaces
7 sequences quotations macros system combinators splitting ;
10 : nmake-cmd ( -- args )
11 { "nmake" "/f" "nmakefile" }
12 target-cpu get name>> "." split "-" join suffix ;
14 : gnu-make-cmd ( -- args )
16 target-os get name>> target-cpu get name>> (platform)
19 : make-cmd ( -- args )
21 { [ target-os get windows = ] [ nmake-cmd ] }
29 "../compile-log" >>stdout
34 : factor-vm ( -- string )
35 target-os get windows = "./factor.com" "./factor" ? ;
40 "-i=" boot-image-name append ,
50 "../boot-log" >>stdout
56 : test-cmd ( -- cmd ) factor-vm "-run=mason.test" 2array ;
63 "../test-log" >>stdout
69 : recover-else ( try catch else -- )
70 [ [ '[ @ f t ] ] [ '[ @ f ] ] bi* recover ] dip '[ drop @ ] when ; inline
72 MACRO: recover-cond ( alist -- )
73 dup { [ length 1 = ] [ first callable? ] } 1&&
75 [ first first2 ] [ rest ] bi
76 '[ _ _ [ _ recover-cond ] recover-else ]
79 : build-child ( -- status )
81 { [ notify-make-vm make-vm ] [ compile-failed ] }
82 { [ notify-boot boot ] [ boot-failed ] }
83 { [ notify-test test ] [ test-failed ] }