Add support for autoconf/configure chain.
[hadrian.git] / src / Config.hs
1 module Config (
2 autoconfRules, configureRules, cfgPath
3 ) where
4
5 import Development.Shake
6 import Development.Shake.Command
7 import Development.Shake.FilePath
8 import Development.Shake.Rule
9 import Control.Applicative
10 import Control.Monad
11 import Base
12
13 cfgPath :: FilePath
14 cfgPath = "shake" </> "cfg"
15
16 autoconfRules :: Rules ()
17 autoconfRules = do
18 "configure" %> \out -> do
19 copyFile' (cfgPath </> "configure.ac") "configure.ac"
20 cmd "bash autoconf"
21
22 configureRules :: Rules ()
23 configureRules = do
24 cfgPath </> "default.config" %> \out -> do
25 need [cfgPath </> "default.config.in", "configure"]
26 cmd "bash configure"