summaryrefslogtreecommitdiff
path: root/compiler/ghc.mk
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2019-06-20 18:04:30 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-07-09 22:56:18 -0400
commit24782b89907ab36fb5aef3a17584f4c10f1e2690 (patch)
treeb0d55f9b146f33fc901aa10b166a647aeded0c0e /compiler/ghc.mk
parent0472f0f6a92395d478e9644c0dbd12948518099f (diff)
downloadhaskell-24782b89907ab36fb5aef3a17584f4c10f1e2690.tar.gz
Deduplicate "unique subdir" code between GHC and Cabal
The code, including the generated module with the version, is now in ghc-boot. Config.hs reexports stuff as needed, ghc-pkg doesn't need any tricks at all.
Diffstat (limited to 'compiler/ghc.mk')
-rw-r--r--compiler/ghc.mk26
1 files changed, 13 insertions, 13 deletions
diff --git a/compiler/ghc.mk b/compiler/ghc.mk
index 1cd82d1635..4e0fb9095b 100644
--- a/compiler/ghc.mk
+++ b/compiler/ghc.mk
@@ -49,33 +49,33 @@ compiler/stage%/build/Config.hs : mk/config.mk mk/project.mk | $$(dir $$@)/.
$(call removeFiles,$@)
@echo 'Creating $@ ... '
@echo '{-# LANGUAGE CPP #-}' >> $@
- @echo 'module Config where' >> $@
+ @echo 'module Config' >> $@
+ @echo ' ( module GHC.Version' >> $@
+ @echo ' , cBuildPlatformString' >> $@
+ @echo ' , cHostPlatformString' >> $@
+ @echo ' , cProjectName' >> $@
+ @echo ' , cBooterVersion' >> $@
+ @echo ' , cStage' >> $@
+ @echo ' ) where' >> $@
@echo >> $@
@echo 'import GhcPrelude' >> $@
@echo >> $@
+ @echo 'import GHC.Version' >> $@
+ @echo >> $@
@echo '#include "ghc_boot_platform.h"' >> $@
@echo >> $@
@echo 'cBuildPlatformString :: String' >> $@
@echo 'cBuildPlatformString = BuildPlatform_NAME' >> $@
+ @echo >> $@
@echo 'cHostPlatformString :: String' >> $@
@echo 'cHostPlatformString = HostPlatform_NAME' >> $@
@echo >> $@
@echo 'cProjectName :: String' >> $@
@echo 'cProjectName = "$(ProjectName)"' >> $@
- @echo 'cProjectGitCommitId :: String' >> $@
- @echo 'cProjectGitCommitId = "$(ProjectGitCommitId)"' >> $@
- @echo 'cProjectVersion :: String' >> $@
- @echo 'cProjectVersion = "$(ProjectVersion)"' >> $@
- @echo 'cProjectVersionInt :: String' >> $@
- @echo 'cProjectVersionInt = "$(ProjectVersionInt)"' >> $@
- @echo 'cProjectPatchLevel :: String' >> $@
- @echo 'cProjectPatchLevel = "$(ProjectPatchLevel)"' >> $@
- @echo 'cProjectPatchLevel1 :: String' >> $@
- @echo 'cProjectPatchLevel1 = "$(ProjectPatchLevel1)"' >> $@
- @echo 'cProjectPatchLevel2 :: String' >> $@
- @echo 'cProjectPatchLevel2 = "$(ProjectPatchLevel2)"' >> $@
+ @echo >> $@
@echo 'cBooterVersion :: String' >> $@
@echo 'cBooterVersion = "$(GhcVersion)"' >> $@
+ @echo >> $@
@echo 'cStage :: String' >> $@
@echo 'cStage = show (STAGE :: Int)' >> $@
@echo done.