Browse files

Install object files from packages

  • Loading branch information...
1 parent 4cec951 commit 734a4dab297b181a480c55a46dd335ece92efbdd Edwin Brady committed Sep 25, 2012
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/Pkg/Package.hs
View
9 src/Pkg/Package.hs
@@ -64,6 +64,7 @@ installPkg pkgdesc
case (execout pkgdesc) of
Nothing -> mapM_ (installIBC (pkgname pkgdesc)) (modules pkgdesc)
Just o -> return () -- do nothing, keep executable locally, for noe
+ mapM_ (installObj (pkgname pkgdesc)) (objs pkgdesc)
buildMod :: [Opt] -> Name -> IO ()
buildMod opts n = do let f = map slash $ show n
@@ -114,6 +115,14 @@ installIBC p m = do let f = toIBCFile m
where getDest (UN n) = ""
getDest (NS n ns) = concat (intersperse "/" (reverse ns)) ++ "/" ++ getDest n
+installObj :: String -> String -> IO ()
+installObj p o = do d <- getDataDir
+ let destdir = d ++ "/" ++ p ++ "/"
+ putStrLn $ "Installing " ++ o ++ " to " ++ destdir
+ system $ "mkdir -p " ++ destdir
+ system $ "install " ++ o ++ " " ++ destdir
+ return ()
+
make :: Maybe String -> IO ()
make Nothing = return ()
make (Just s) = do system $ "make -f " ++ s

0 comments on commit 734a4da

Please sign in to comment.