Commit 622d3c16 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Simplify build rule interfaces.

parent 031179a7
......@@ -30,5 +30,5 @@ packageRules :: Rules ()
packageRules =
forM_ [Stage0, Stage1] $ \stage -> do
forM_ targetPackages $ \pkg -> do
let dir = pkgPath pkg </> targetDirectory stage pkg
buildPackage stage pkg dir targetWays buildSettings
let env = defaultEnvironment { getStage = stage, getPackage = pkg }
buildPackage env targetWays buildSettings
......@@ -140,8 +140,12 @@ postProcessPackageData file = do
-- * otherwise, we must collapse it into one space-separated string
-- Build package-data.mk by using GhcCabal to process pkgCabal file
buildPackageData :: Stage -> Package -> FilePath -> Ways -> Settings -> Rules ()
buildPackageData stage pkg dir ways settings =
buildPackageData :: Environment -> Ways -> Settings -> Rules ()
buildPackageData env ways settings =
let stage = getStage env
pkg = getPackage env
dir = pkgPath pkg </> targetDirectory stage pkg
in
(dir </>) <$>
[ "package-data.mk"
, "haddock-prologue.txt"
......@@ -152,7 +156,6 @@ buildPackageData stage pkg dir ways settings =
-- , "build" </> "autogen" </> ("Paths_" ++ name) <.> "hs"
] &%> \_ -> do
let configure = pkgPath pkg </> "configure"
env = defaultEnvironment { getStage = stage, getPackage = pkg }
need [pkgPath pkg </> pkgCabal pkg]
-- GhcCabal will run the configure script, so we depend on it
-- We still don't know who build the configure script from configure.ac
......
......@@ -3,10 +3,9 @@ module Rules.Package (
) where
import Base
import Package
import Rules.Data
import Expression
import Expression.Settings
buildPackage :: Stage -> Package -> FilePath -> Ways -> Settings -> Rules ()
buildPackage :: Environment -> Ways -> Settings -> Rules ()
buildPackage = buildPackageData
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