Commit 7d42fdac authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Clean up rules related to dependency lists.

parent d6744a70
......@@ -48,7 +48,7 @@ buildRule pkg @ (Package name path _) todo @ (stage, dist, _) =
let oPattern = "*." ++ osuf way
let hiPattern = "*." ++ hisuf way
[buildDir <//> oPattern, buildDir <//> hiPattern] |%> \out -> do
need [argListPath argListDir pkg stage, hDepFile, cDepFile]
need [argListPath argListDir pkg stage]
let obj = toStandard $ out -<.> osuf way
vanillaObj = toStandard $ out -<.> "o"
-- TODO: keep only vanilla dependencies in hDepFile
......
......@@ -16,7 +16,7 @@ ghcArgs (Package name path _) (stage, dist, settings) =
, includeGhcArgs path dist
, concatArgs ["-optP"] $ CppArgs pathDist
, productArgs ["-odir", "-stubdir", "-hidir"] buildDir
, args ["-dep-makefile", depFile <.> "new"]
, args ["-dep-makefile", depFile ]
, productArgs "-dep-suffix" $ map wayPrefix <$> ways settings
, args $ HsArgs pathDist
, args $ pkgHsSources path dist ]
......@@ -60,19 +60,17 @@ buildRule :: Package -> TodoItem -> Rules ()
buildRule pkg @ (Package name path _) todo @ (stage, dist, settings) = do
let pathDist = path </> dist
buildDir = pathDist </> "build"
hDepFile = buildDir </> "haskell.deps"
cDepFile = buildDir </> "c.deps"
hDepFile %> \out -> do
(buildDir </> "haskell.deps") %> \out -> do
need [argListPath argListDir pkg stage]
terseRun (Ghc stage) $ ghcArgs pkg todo
-- Avoid rebuilding dependecies of out if it hasn't changed:
-- Note: cannot use copyFileChanged as it depends on the source file
deps <- liftIO $ readFile $ out <.> "new"
writeFileChanged out deps
liftIO $ removeFiles "." [out <.> "new"]
--deps <- liftIO $ readFile $ out <.> "new"
--writeFileChanged out deps
--liftIO $ removeFiles "." [out <.> "new"]
cDepFile %> \out -> do
(buildDir </> "c.deps") %> \out -> do
need [argListPath argListDir pkg stage]
srcs <- args $ CSrcs pathDist
deps <- fmap concat $ forM srcs $ \src -> do
......
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