Cc.hs 1021 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
Zhen Zhang's avatar
Zhen Zhang committed
6 7 8
ccBuilderArgs = do
  way <- getWay
  builder Cc ? mconcat
9 10 11 12
    [ append =<< getPkgDataList CcArgs
    , argSettingList . ConfCcArgs =<< getStage
    , cIncludeArgs

Zhen Zhang's avatar
Zhen Zhang committed
13
    , builder (Cc CompileC) ? mconcat [ arg "-Werror"
Zhen Zhang's avatar
Zhen Zhang committed
14 15
                                      , (Dynamic `wayUnit` way) ?
				        append [ "-fPIC", "-DDYNAMIC" ]
Zhen Zhang's avatar
Zhen Zhang committed
16 17 18
                                      -- mk/warning.mk:
                                      --  SRC_CC_OPTS     += -Wall $(WERROR)
                                      , arg "-c", arg =<< getInput
Andrey Mokhov's avatar
Andrey Mokhov committed
19
                                      , arg "-o", arg =<< getOutput ]
20

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