[project @ 2004-11-09 16:59:31 by simonmar]
[ghc-hetmet.git] / ghc / utils / ghc-pkg / Makefile
index 26003d0..5280887 100644 (file)
@@ -10,16 +10,9 @@ INSTALLING=1
 # ghc-pkg.bin
 
 ghc_ge_504 = $(shell if (test $(GhcCanonVersion) -ge 504); 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      += -cpp -DPKG_TOOL -DWANT_PRETTY
 
-ifeq "$(HOSTPLATFORM)$(ghc_le_600)" "i386-unknown-mingw32YES"
-SRC_HC_OPTS += -D'GHC_PKG_VERSION=\"$(ProjectVersion)\"'
-else
-SRC_HC_OPTS += -D'GHC_PKG_VERSION="$(ProjectVersion)"'
-endif
-
 ifeq "$(ghc_ge_504)" "NO"
 SRC_HC_OPTS +=  -package lang -package util -package text
 endif
@@ -36,6 +29,20 @@ HS_PROG           = ghc-pkg.bin
 INSTALL_LIBEXECS += $(HS_PROG)
 endif
 
+# -----------------------------------------------------------------------------=
+# 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)
+
 # -----------------------------------------------------------------------------
 # ghc-pkg script