Cc.hs 890 Bytes
Newer Older
1
module Settings.Builders.Cc (ccBuilderArgs) where
2

3
import Settings.Builders.Common
4

Andrey Mokhov's avatar
Andrey Mokhov committed
5
ccBuilderArgs :: Args
6 7 8 9 10
ccBuilderArgs = builder Cc ? mconcat
    [ append =<< getPkgDataList CcArgs
    , argSettingList . ConfCcArgs =<< getStage
    , cIncludeArgs

Zhen Zhang's avatar
Zhen Zhang committed
11 12 13 14
    , builder (Cc CompileC) ? mconcat [ arg "-Werror"
                                      -- mk/warning.mk:
                                      --  SRC_CC_OPTS     += -Wall $(WERROR)
                                      , arg "-c", arg =<< getInput
Andrey Mokhov's avatar
Andrey Mokhov committed
15
                                      , arg "-o", arg =<< getOutput ]
16

17
    , builder (Cc FindCDependencies) ? do
18 19
        output <- getOutput
        mconcat [ arg "-E"
20 21 22 23
                , arg "-MM", arg "-MG"
                , arg "-MF", arg output
                , arg "-MT", arg $ dropExtension output -<.> "o"
                , arg "-x", arg "c"
24
                , arg =<< getInput ] ]