Install a versioned ghc-pkg script; fixes trac #2662
authorIan Lynagh <igloo@earth.li>
Thu, 9 Oct 2008 16:49:46 +0000 (16:49 +0000)
committerIan Lynagh <igloo@earth.li>
Thu, 9 Oct 2008 16:49:46 +0000 (16:49 +0000)
driver/Makefile
driver/ghc-pkg/Makefile [new file with mode: 0644]

index 5207214..016eab2 100644 (file)
@@ -7,7 +7,7 @@
 TOP=..
 include $(TOP)/mk/boilerplate.mk
 
-SUBDIRS = mangler split ghc ghci runhaskell
+SUBDIRS = mangler split ghc ghc-pkg ghci runhaskell
 
 INPLACE_PKG_CONF = $(INPLACE_DATA_DIR)/package.conf
 # Used to signal that we are inplace, as opposed to installed:
diff --git a/driver/ghc-pkg/Makefile b/driver/ghc-pkg/Makefile
new file mode 100644 (file)
index 0000000..2ee42d5
--- /dev/null
@@ -0,0 +1,18 @@
+TOP=../..
+include $(TOP)/mk/boilerplate.mk
+
+ifneq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
+SCRIPT_DIR = $(DESTDIR)$(bindir)
+SCRIPT_BASE = ghc-pkg
+SCRIPT_VERSIONED_BASE = $(SCRIPT_BASE)-$(ProjectVersion)
+SCRIPT           = $(SCRIPT_DIR)/$(SCRIPT_BASE)
+SCRIPT_VERSIONED = $(SCRIPT_DIR)/$(SCRIPT_VERSIONED_BASE)
+
+install::
+       mv $(SCRIPT) $(SCRIPT_VERSIONED)
+       ln -s $(SCRIPT_VERSIONED_BASE) $(SCRIPT)
+endif
+
+include $(TOP)/mk/bindist.mk
+
+include $(TOP)/mk/target.mk