From d512b30d2aded9a8671d3b42baf91e2a32fc043e Mon Sep 17 00:00:00 2001 From: Moritz Angermann Date: Wed, 8 Nov 2017 15:48:00 +0800 Subject: [PATCH] Cleanup Generate a bit. --- src/Rules/Generate.hs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Rules/Generate.hs b/src/Rules/Generate.hs index 0d55996daf..3761b6a5e2 100644 --- a/src/Rules/Generate.hs +++ b/src/Rules/Generate.hs @@ -49,6 +49,9 @@ primopsTxt stage = buildDir (vanillaContext stage compiler) -/- "primops.txt" platformH :: Stage -> FilePath platformH stage = buildDir (vanillaContext stage compiler) -/- "ghc_boot_platform.h" +versionsH :: Stage -> FilePath +versionsH stage = buildDir (vanillaContext stage compiler) -/- "HsVersions.h" + isGeneratedCmmFile :: FilePath -> Bool isGeneratedCmmFile file = takeBaseName file == "AutoApply" @@ -143,7 +146,9 @@ generatePackageCode context@(Context stage pkg _) = when (pkg == compiler) $ do "//" ++ primopsTxt stage %> \file -> do root <- buildRoot - need $ [root -/- platformH stage, primopsSource] + need $ [ root -/- platformH stage + , root -/- versionsH stage + , primopsSource] ++ fmap (root -/-) includesDependencies build $ target context HsCpp [primopsSource] [file] @@ -152,6 +157,9 @@ generatePackageCode context@(Context stage pkg _) = when (stage == Stage0) $ do "//compiler/ghc_boot_platform.h" %> go generateGhcBootPlatformH "//" ++ platformH stage %> go generateGhcBootPlatformH + "//" ++ versionsH stage %> \file -> do + dir <- return "compiler" + copyFile (dir -/- takeFileName file) file when (pkg == rts) $ "//" ++ dir -/- "cmm/AutoApply.cmm" %> \file -> build $ target context GenApply [] [file]