Commit 92352f77 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Fix missing options and pkgDepObjects.

parent 02297c23
......@@ -122,9 +122,10 @@ pkgDepObjects :: FilePath -> FilePath -> Way -> Action [FilePath]
pkgDepObjects path dist way = do
let pkgData = path </> dist </> "package-data.mk"
buildDir = path </> dist </> "build"
hs2obj = (buildDir ++) . drop (length path) . (-<.> osuf way)
srcs <- pkgHsSources path dist
return $ map (toStandard . hs2obj) srcs
dirs <- map (normaliseEx . (path </>)) <$> arg (SrcDirs pkgData)
fmap concat $ forM dirs $ \d ->
map (toStandard . (buildDir ++) . (-<.> osuf way) . drop (length d))
<$> (findModuleFiles pkgData [d] [".hs", ".lhs"])
-- Find objects that go to library
pkgLibObjects :: FilePath -> FilePath -> Stage -> Way -> Action [FilePath]
......
......@@ -48,6 +48,7 @@ oRule (Package name path _) (stage, dist, settings) =
<> arg SrcHcOpts
<> packageArgs stage pkgData
<> includeArgs path dist
<> concatArgs ["-optP"] (CppOpts pkgData)
-- TODO: now we have both -O and -O2
<> arg ["-Wall", "-XHaskell2010", "-O2"]
<> productArgs ["-odir", "-hidir", "-stubdir"] buildDir
......@@ -55,7 +56,7 @@ oRule (Package name path _) (stage, dist, settings) =
<> arg ("-c":srcs)
<> arg ["-o", toStandard out]
-- TODO: This rule looks a bit of a hack... combine it with the above?
-- TODO: This rule looks hacky... combine it with the above?
hiRule :: Package -> TodoItem -> Rules ()
hiRule (Package name path _) (stage, dist, settings) =
let buildDir = path </> dist </> "build"
......
......@@ -13,6 +13,7 @@ buildPackageDependencies (Package name path _) (stage, dist, settings) =
terseRun (Ghc stage) $ arg "-M"
<> packageArgs stage pkgData
<> includeArgs path dist
<> concatArgs ["-optP"] (CppOpts pkgData)
<> productArgs ["-odir", "-stubdir", "-hidir"] buildDir
<> arg ["-dep-makefile", toStandard $ out <.> "new"]
<> productArgs "-dep-suffix" (map wayPrefix <$> ways settings)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment