Cc.hs 1.04 KB
Newer Older
1
module Settings.Builders.Cc (ccBuilderArgs) where
2

3
import Base
4
import Oracles.Config.Setting
Andrey Mokhov's avatar
Andrey Mokhov committed
5
import Oracles.PackageData
6
import Predicate
7
import Settings.Builders.Common
Andrey Mokhov's avatar
Andrey Mokhov committed
8
import Settings
9

Andrey Mokhov's avatar
Andrey Mokhov committed
10
ccBuilderArgs :: Args
11 12 13 14 15 16 17
ccBuilderArgs = builder Cc ? mconcat
    [ append =<< getPkgDataList CcArgs
    , argSettingList . ConfCcArgs =<< getStage
    , cIncludeArgs

    , builder (Cc CompileC) ?
        mconcat [ arg "-c", arg =<< getInput
18
                , arg "-o", arg =<< getOutput ]
19

20
    , builder (Cc FindCDependencies) ? do
21 22 23 24 25 26 27 28 29
        output <- getOutput
        mconcat [ arg "-E"
                , arg "-MM"
                , arg "-MF"
                , arg output
                , arg "-MT"
                , arg $ dropExtension output -<.> "o"
                , arg "-x"
                , arg "c"
30 31
                , arg =<< getInput ]

32
    , builder (Cc FindMissingInclude) ?
33 34 35 36 37
        mconcat [ arg "-E"
                , arg "-MM"
                , arg "-MG"
                , arg "-MF"
                , arg =<< getOutput
38
                , arg =<< getInput ]
39
    ]