summaryrefslogtreecommitdiff
path: root/libraries/ghc-boot/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 /libraries/ghc-boot/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 'libraries/ghc-boot/ghc.mk')
-rw-r--r--libraries/ghc-boot/ghc.mk36
1 files changed, 36 insertions, 0 deletions
diff --git a/libraries/ghc-boot/ghc.mk b/libraries/ghc-boot/ghc.mk
new file mode 100644
index 0000000000..29c5376560
--- /dev/null
+++ b/libraries/ghc-boot/ghc.mk
@@ -0,0 +1,36 @@
+libraries/ghc-boot_PACKAGE = ghc-boot
+libraries/ghc-boot_dist-install_GROUP = libraries
+$(if $(filter ghc-boot,$(PACKAGES_STAGE0)),$(eval $(call build-package,libraries/ghc-boot,dist-boot,0)))
+$(if $(filter ghc-boot,$(PACKAGES_STAGE1)),$(eval $(call build-package,libraries/ghc-boot,dist-install,1)))
+$(if $(filter ghc-boot,$(PACKAGES_STAGE2)),$(eval $(call build-package,libraries/ghc-boot,dist-install,2)))
+
+libraries/ghc-boot/dist-boot/build/GHC/Version.hs \
+libraries/ghc-boot/dist-install/build/GHC/Version.hs: mk/project.mk | $$(dir $$@)/.
+ $(call removeFiles,$@)
+ @echo "module GHC.Version where" >> $@
+ @echo >> $@
+ @echo 'import Prelude -- See Note [Why do we import Prelude here?]' >> $@
+ @echo >> $@
+ @echo 'cProjectGitCommitId :: String' >> $@
+ @echo 'cProjectGitCommitId = "$(ProjectGitCommitId)"' >> $@
+ @echo >> $@
+ @echo 'cProjectVersion :: String' >> $@
+ @echo 'cProjectVersion = "$(ProjectVersion)"' >> $@
+ @echo >> $@
+ @echo 'cProjectVersionInt :: String' >> $@
+ @echo 'cProjectVersionInt = "$(ProjectVersionInt)"' >> $@
+ @echo >> $@
+ @echo 'cProjectPatchLevel :: String' >> $@
+ @echo 'cProjectPatchLevel = "$(ProjectPatchLevel)"' >> $@
+ @echo >> $@
+ @echo 'cProjectPatchLevel1 :: String' >> $@
+ @echo 'cProjectPatchLevel1 = "$(ProjectPatchLevel1)"' >> $@
+ @echo >> $@
+ @echo 'cProjectPatchLevel2 :: String' >> $@
+ @echo 'cProjectPatchLevel2 = "$(ProjectPatchLevel2)"' >> $@
+ @echo done.
+
+libraries/ghc-boot/dist-boot/package-data.mk: \
+ libraries/ghc-boot/dist-boot/build/GHC/Version.hs
+libraries/ghc-boot/dist-install/package-data.mk: \
+ libraries/ghc-boot/dist-install/build/GHC/Version.hs