Cc.hs 870 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
    [ append =<< getPkgDataList CcArgs
10
    , getSettingList . ConfCcArgs =<< getStage
11 12
    , cIncludeArgs

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