[project @ 2004-11-10 03:20:31 by wolfgang]
[ghc-hetmet.git] / ghc / utils / ghc-pkg / Makefile
index 1cad689..5280887 100644 (file)
@@ -1,5 +1,4 @@
 # -----------------------------------------------------------------------------
-# $Id: Makefile,v 1.22 2003/06/04 15:18:29 panne Exp $
 
 TOP=../..
 include $(TOP)/mk/boilerplate.mk
@@ -10,10 +9,10 @@ INSTALLING=1
 # -----------------------------------------------------------------------------
 # ghc-pkg.bin
 
-SRC_HC_OPTS      += -cpp -DPKG_TOOL -DWANT_PRETTY
-
 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
@@ -30,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