[project @ 2004-11-10 03:20:31 by wolfgang]
[ghc-hetmet.git] / ghc / utils / ghc-pkg / Makefile
index 45d2eff..5280887 100644 (file)
@@ -9,10 +9,10 @@ INSTALLING=1
 # -----------------------------------------------------------------------------
 # ghc-pkg.bin
 
-SRC_HC_OPTS      += -cpp -DPKG_TOOL -DWANT_PRETTY -D'GHC_PKG_VERSION="$(ProjectVersion)"'
-
 ghc_ge_504 = $(shell if (test $(GhcCanonVersion) -ge 504); then echo YES; else echo NO; fi)
 
+SRC_HC_OPTS      += -cpp -DPKG_TOOL -DWANT_PRETTY
+
 ifeq "$(ghc_ge_504)" "NO"
 SRC_HC_OPTS +=  -package lang -package util -package text
 endif
@@ -29,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