-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMAKE
executable file
·39 lines (33 loc) · 975 Bytes
/
MAKE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/runhaskell
import System.Environment
import System.Process
import System.Console.ANSI
import Data.List
import Data.Maybe
main = do
args <- getArgs
case args of
["buildAll"] -> buildAll
["dist"] -> dist
_ -> putStrLn "argument not recognised."
dist = return ()
-- locally edited, for privacy reasons (it could be parametrised
-- by the environment, but i'll kis)
line = take 80 $ repeat '%'
buildAll = do
env <- getEnvironment
let pwd = fromJust $ lookup "PWD" env
alert "BUILDING REQUIRE" Red
callCommand $
"cd " ++
pwd ++ "/lib/require ; cabal install --force-reinstalls; cabal haddock"
alert "BUILDING POLYREC" Red
callCommand $
"cd " ++
pwd ++ "/lib/poly-rec ; cabal install --force-reinstalls; cabal haddock"
alert "BUILDING AAG" Red
callCommand "cabal install; cabal haddock"
alert s c = do
setSGR [SetColor Foreground Vivid c]
putStrLn $ line ++ "\n" ++ s ++ "\n" ++ line
setSGR [Reset]