diff options
author | simonmar <unknown> | 2004-08-31 13:09:42 +0000 |
---|---|---|
committer | simonmar <unknown> | 2004-08-31 13:09:42 +0000 |
commit | b3fbc8674b3fe6769580ee26fa2d5812889e463a (patch) | |
tree | b653fc55ae98df7fc9fb093f77f1031ea9cc58e4 | |
parent | e6982912efacef7a78bc2dc98607622a81566a3f (diff) |
[haddock @ 2004-08-31 13:09:42 by simonmar]
Avoid GHC/shell versionitis and create Version.hs
-rw-r--r-- | src/HaddockVersion.hs | 6 | ||||
-rw-r--r-- | src/Makefile | 25 |
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" |