diff options
Diffstat (limited to 'hadrian')
-rw-r--r-- | hadrian/src/Rules/Generate.hs | 57 | ||||
-rw-r--r-- | hadrian/src/Rules/Lint.hs | 3 |
2 files changed, 4 insertions, 56 deletions
diff --git a/hadrian/src/Rules/Generate.hs b/hadrian/src/Rules/Generate.hs index b156c9dfdf..c72002eb56 100644 --- a/hadrian/src/Rules/Generate.hs +++ b/hadrian/src/Rules/Generate.hs @@ -146,10 +146,10 @@ generatePackageCode context@(Context stage pkg _ _) = do when (pkg == rts) $ do root -/- "**" -/- dir -/- "cmm/AutoApply.cmm" %> \file -> build $ target context GenApply [] [file] - let go gen file = generate file (semiEmptyTarget stage) gen root -/- "**" -/- dir -/- "include/ghcautoconf.h" %> \_ -> need . pure =<< pkgSetupConfigFile context - root -/- "**" -/- dir -/- "include/ghcplatform.h" %> go generateGhcPlatformH + root -/- "**" -/- dir -/- "include/ghcplatform.h" %> \_ -> + need . pure =<< pkgSetupConfigFile context root -/- "**" -/- dir -/- "include/DerivedConstants.h" %> genPlatformConstantsHeader context root -/- "**" -/- dir -/- "include/rts/EventLogConstants.h" %> genEventTypes "--event-types-defines" root -/- "**" -/- dir -/- "include/rts/EventTypes.h" %> genEventTypes "--event-types-array" @@ -320,59 +320,6 @@ ghcWrapper stage = do else []) ++ [ "$@" ] --- | Given a 'String' replace characters '.' and '-' by underscores ('_') so that --- the resulting 'String' is a valid C preprocessor identifier. -cppify :: String -> String -cppify = replaceEq '-' '_' . replaceEq '.' '_' - --- | Generate @ghcplatform.h@ header. -generateGhcPlatformH :: Expr String -generateGhcPlatformH = do - trackGenerateHs - stage <- getStage - let chooseSetting x y = getSetting $ case stage of { Stage0 {} -> x; _ -> y } - buildPlatform <- chooseSetting BuildPlatform HostPlatform - buildArch <- chooseSetting BuildArch HostArch - buildOs <- chooseSetting BuildOs HostOs - buildVendor <- chooseSetting BuildVendor HostVendor - hostPlatform <- chooseSetting HostPlatform TargetPlatform - hostArch <- chooseSetting HostArch TargetArch - hostOs <- chooseSetting HostOs TargetOs - hostVendor <- chooseSetting HostVendor TargetVendor - ghcUnreg <- getFlag GhcUnregisterised - return . unlines $ - [ "#if !defined(__GHCPLATFORM_H__)" - , "#define __GHCPLATFORM_H__" - , "" - , "#define BuildPlatform_TYPE " ++ cppify buildPlatform - , "#define HostPlatform_TYPE " ++ cppify hostPlatform - , "" - , "#define " ++ cppify buildPlatform ++ "_BUILD 1" - , "#define " ++ cppify hostPlatform ++ "_HOST 1" - , "" - , "#define " ++ buildArch ++ "_BUILD_ARCH 1" - , "#define " ++ hostArch ++ "_HOST_ARCH 1" - , "#define BUILD_ARCH " ++ show buildArch - , "#define HOST_ARCH " ++ show hostArch - , "" - , "#define " ++ buildOs ++ "_BUILD_OS 1" - , "#define " ++ hostOs ++ "_HOST_OS 1" - , "#define BUILD_OS " ++ show buildOs - , "#define HOST_OS " ++ show hostOs - , "" - , "#define " ++ buildVendor ++ "_BUILD_VENDOR 1" - , "#define " ++ hostVendor ++ "_HOST_VENDOR 1" - , "#define BUILD_VENDOR " ++ show buildVendor - , "#define HOST_VENDOR " ++ show hostVendor - , "" - ] - ++ - [ "#define UnregisterisedCompiler 1" | ghcUnreg ] - ++ - [ "" - , "#endif /* __GHCPLATFORM_H__ */" - ] - -- See Note [tooldir: How GHC finds mingw on Windows] generateSettings :: Expr String generateSettings = do diff --git a/hadrian/src/Rules/Lint.hs b/hadrian/src/Rules/Lint.hs index 0928ec02eb..2a145d30b3 100644 --- a/hadrian/src/Rules/Lint.hs +++ b/hadrian/src/Rules/Lint.hs @@ -20,6 +20,8 @@ lintRules = do cmd_ (Cwd "libraries/base") "./configure" "rts" -/- "include" -/- "ghcautoconf.h" %> \_ -> cmd_ (Cwd "rts") "./configure" + "rts" -/- "include" -/- "ghcplatform.h" %> \_ -> + cmd_ (Cwd "rts") "./configure" lint :: Action () -> Action () lint lintAction = do @@ -66,7 +68,6 @@ base = do let includeDirs = [ "rts/include" , "libraries/base/include" - , stage1RtsInc ] runHLint includeDirs [] "libraries/base" |