@@ -28,8 +28,11 @@ mvn verbosity = P.runProgramInvocation verbosity . P.simpleProgramInvocation "mv
2828(<//>) = (Px.</>)
2929idrisCmd local = Px.joinPath $ splitDirectories $
3030 ".." <//> buildDir local <//> "idris" <//> "idris"
31+rtsDir local = Px.joinPath $ splitDirectories $
32+ ".." <//> buildDir local <//> "rts" <//> "libidris_rts"
3133#else
3234idrisCmd local = ".." </> buildDir local </> "idris" </> "idris"
35+rtsDir local = ".." </> buildDir local </> "rts" </> "libidris_rts"
3336#endif
3437
3538cleanStdLib verbosity
@@ -53,11 +56,13 @@ installStdLib pkg local verbosity copy
5356 [ "-C", "lib", "install"
5457 , "TARGET=" ++ idir
5558 , "IDRIS=" ++ icmd
59+ , "RTS=" ++ rtsDir local
5660 ]
5761 make verbosity
5862 [ "-C", "effects", "install"
5963 , "TARGET=" ++ idir
6064 , "IDRIS=" ++ icmd
65+ , "RTS=" ++ rtsDir local
6166 ]
6267 let idirRts = idir </> "rts"
6368 putStrLn $ "Installing run time system in " ++ idirRts
@@ -65,6 +70,7 @@ installStdLib pkg local verbosity copy
6570 [ "-C", "rts", "install"
6671 , "TARGET=" ++ idirRts
6772 , "IDRIS=" ++ icmd
73+ , "RTS=" ++ rtsDir local
6874 ]
6975
7076installJavaLib pkg local verbosity copy version = do
@@ -99,16 +105,25 @@ checkStdLib local verbosity
99105 make verbosity
100106 [ "-C", "lib", "check"
101107 , "IDRIS=" ++ icmd
108+ , "RTS=" ++ rtsDir local
102109 ]
103110 make verbosity
104111 [ "-C", "effects", "check"
105112 , "IDRIS=" ++ icmd
113+ , "RTS=" ++ rtsDir local
106114 ]
107115 make verbosity
108116 [ "-C", "rts", "check"
109117 , "IDRIS=" ++ icmd
110118 ]
111119
120+buildRTS dir verbosity
121+ = do putStrLn "Building RTS..."
122+ make verbosity
123+ [ "-C", "rts", "build"
124+ , "DIST=../" ++ dir
125+ ]
126+
112127checkJavaLib verbosity = mvn verbosity [ "-f", "java" </> "pom.xml", "package" ]
113128
114129javaFlag flags =
@@ -155,6 +170,8 @@ main = do
155170 cleanJavaLib verb
156171 , postBuild = \ _ flags _ lbi -> do
157172 let verb = S.fromFlag $ S.buildVerbosity flags
173+ let distdir = buildDir lbi
174+ buildRTS distdir verb
158175 checkStdLib lbi verb
159176 when (javaFlag $ configFlags lbi) (checkJavaLib verb)
160177 }