@@ -5,6 +5,7 @@ import System.Directory
55import System.Exit
66import System.IO
77import System.FilePath ((</>), addTrailingPathSeparator)
8+import System.Environment (lookupEnv)
89
910import Util.System
1011
@@ -101,7 +102,8 @@ toIBCFile (NS n ns) = foldl1 (</>) (reverse (toIBCFile n : ns))
101102
102103installIBC :: String -> Name -> IO ()
103104installIBC p m = do let f = toIBCFile m
104− d <- getDataDir
105+ target <- lookupEnv "TARGET"
106+ d <- maybe getDataDir return target
105107 let destdir = d </> p </> getDest m
106108 putStrLn $ "Installing " ++ f ++ " to " ++ destdir
107109 system $ "mkdir -p " ++ destdir