Initial version of FindMissingInclude
[hadrian.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 Predicate
7 import Settings.Builders.Common
8 import Settings
9
10 -- TODO: handle custom $1_$2_MKDEPENDC_OPTS and
11 ccBuilderArgs :: Args
12 ccBuilderArgs = mconcat
13 [ builder (Cc CompileC) ?
14 mconcat [ commonCcArgs
15 , arg "-c", arg =<< getInput
16 , arg "-o", arg =<< getOutput ]
17
18 , builder (Cc FindCDependencies) ? 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 , builder (Cc FindMissingInclude) ? do
32 mconcat [ arg "-E"
33 , arg "-MM"
34 , arg "-MG"
35 , commonCcArgs
36 , arg "-MF"
37 , arg =<< getOutput
38 , arg =<< getInput
39 ]
40 ]
41
42 commonCcArgs :: Args
43 commonCcArgs = mconcat [ append =<< getPkgDataList CcArgs
44 , append =<< getSettingList . ConfCcArgs =<< getStage
45 , cIncludeArgs ]