Re-export Expression from Predicates
[ghc.git] / src / Settings / Builders / Cc.hs
1 module Settings.Builders.Cc (ccBuilderArgs) where
2
3 import Base
4 import Oracles.Config.Setting
5 import Oracles.PackageData
6 import Predicates
7 import Settings
8 import Settings.Builders.Common
9
10 -- TODO: handle custom $1_$2_MKDEPENDC_OPTS and
11 ccBuilderArgs :: Args
12 ccBuilderArgs = mconcat
13 [ builder (Cc Compile) ?
14 mconcat [ commonCcArgs
15 , arg "-c", arg =<< getInput
16 , arg "-o", arg =<< getOutput ]
17
18 , builder (Cc FindDependencies) ? do
19 output <- getOutput
20 mconcat [ arg "-E"
21 , arg "-MM"
22 , commonCcArgs
23 , arg "-MF"
24 , arg output
25 , arg "-MT"
26 , arg $ dropExtension output -<.> "o"
27 , arg "-x"
28 , arg "c"
29 , arg =<< getInput ] ]
30
31 commonCcArgs :: Args
32 commonCcArgs = mconcat [ append =<< getPkgDataList CcArgs
33 , append =<< getSettingList . ConfCcArgs =<< getStage
34 , cIncludeArgs ]