Commit 0ddf3b4d authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Minor revision.

See #207.
parent 84782844
......@@ -61,15 +61,16 @@ packageRules = do
let readPackageDb = [(packageDb, 1)]
writePackageDb = [(packageDb, maxConcurrentReaders)]
let contexts = liftM3 Context allStages knownPackages allWays
let contexts = liftM3 Context allStages knownPackages allWays
vanillaContexts = liftM2 vanillaContext allStages knownPackages
traverse_ (compilePackage readPackageDb) contexts
traverse_ (compilePackage readPackageDb) contexts
traverse_ (buildPackageDependencies readPackageDb) vanillaContexts
for_ allStages $ \stage ->
for_ knownPackages $ \package -> do
let context = vanillaContext stage package
buildPackageData context
buildPackageDependencies readPackageDb context
buildPackageDocumentation context
generatePackageCode context
buildPackageLibrary context
......
......@@ -7,7 +7,7 @@ import Expression
import Oracles.Dependencies
import Rules.Actions
import Settings
import Target hiding (context)
import Target
compilePackage :: [(Resource, Int)] -> Context -> Rules ()
compilePackage rs context @ (Context {..}) = do
......
......@@ -19,7 +19,7 @@ buildPackageDependencies rs context @ (Context {..}) =
dropBuild = (pkgPath package ++) . drop (length buildPath)
hDepFile = buildPath -/- ".hs-dependencies"
in do
fmap (buildPath++)
fmap (buildPath ++)
[ "//*.c.deps", "//*.cmm.deps", "//*.S.deps" ] |%> \out -> do
let srcFile = if "//AutoApply.*" ?== out
then dropExtension out
......@@ -32,19 +32,18 @@ buildPackageDependencies rs context @ (Context {..}) =
need srcs
if srcs == []
then writeFileChanged out ""
else buildWithResources rs $
Target context (GhcM stage) srcs [out]
else buildWithResources rs $ Target context (GhcM stage) srcs [out]
removeFileIfExists $ out <.> "bak"
-- TODO: don't accumulate *.deps into .dependencies
(buildPath -/- ".dependencies") %> \out -> do
buildPath -/- ".dependencies" %> \out -> do
cSrcs <- pkgDataList $ CSrcs path
let cDepFiles = [ buildPath -/- src <.> "deps" | src <- cSrcs
, not ("//AutoApply.cmm" ?== src) ]
++ [ src <.> "deps" | src <- cSrcs, "//AutoApply.cmm" ?== src ]
need $ hDepFile : cDepFiles -- need all for more parallelism
cDeps <- fmap concat $ mapM readFile' cDepFiles
cDeps <- fmap concat $ traverse readFile' cDepFiles
hDeps <- readFile' hDepFile
let result = unlines
. map (\(src, deps) -> unwords $ src : deps)
......
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