aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/HaddockVersion.hs6
-rw-r--r--src/Makefile25
2 files changed, 18 insertions, 13 deletions
diff --git a/src/HaddockVersion.hs b/src/HaddockVersion.hs
index a2f51c28..f3090b4e 100644
--- a/src/HaddockVersion.hs
+++ b/src/HaddockVersion.hs
@@ -8,10 +8,10 @@ module HaddockVersion (
projectName, projectVersion, projectUrl
) where
+import Version ( version )
+
projectName, projectUrl :: String
projectName = "Haddock"
projectUrl = "http://www.haskell.org/haddock/"
--- The version comes in via CPP from mk/version.mk
-projectVersion :: String
-projectVersion = HADDOCK_VERSION
+projectVersion = version
diff --git a/src/Makefile b/src/Makefile
index b4997738..b25f1ff0 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -5,7 +5,6 @@ INSTALLING=1
ghc_ge_504 := $(shell if (test $(GhcCanonVersion) -ge 504); then echo YES; else echo NO; fi)
ghc_ge_603 := $(shell if (test $(GhcCanonVersion) -ge 603); then echo YES; else echo NO; fi)
-ghc_le_600 := $(shell if (test $(GhcCanonVersion) -le 600); then echo YES; else echo NO; fi)
SRC_HC_OPTS += -fglasgow-exts -cpp
@@ -35,15 +34,21 @@ endif
HsParser_HC_OPTS += -Onot
HaddockParse_HC_OPTS += -Onot
-# <= 6.0.x (double-)quotes all arguments when invoking utils, hence
-# the need to escape the string quotes here. >= 6.2.x does add a
-# layer of quoting.
-ifeq "$(ghc_le_600)" "YES"
-HaddockVersion_HC_OPTS = -D'HADDOCK_VERSION=\"$(ProjectVersion)\"'
-else
-HaddockVersion_HC_OPTS = -D'HADDOCK_VERSION="$(ProjectVersion)"'
-endif
-HaddockVersion : ../mk/version.mk
+# -----------------------------------------------------------------------------
+# Create the Version.hs file
+
+VERSION_HS = Version.hs
+EXTRA_SRCS += $(VERSION_HS)
+
+boot :: $(VERSION_HS)
+
+Version.hs : $(TOP)/mk/version.mk
+ @$(RM) -f $(VERSION_HS)
+ @echo "Creating $(VERSION_HS) ... "
+ @echo "module Version where" >>$(VERSION_HS)
+ @echo "version = \"$(ProjectVersion)\"" >> $(VERSION_HS)
+
+# -----------------------------------------------------------------------------
ifeq "$(INSTALLING)" "1"
ifeq "$(BIN_DIST)" "1"