Use update-alternatives for handling generic tool names
[ghc-hetmet.git] / Makefile
index 3b0ab36..1ffd36a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -206,7 +206,7 @@ install-docs ::
 # 
 
 ifneq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
-BinDistShScripts = ghc-$(ProjectVersion) ghci-$(ProjectVersion) ghc-pkg-$(ProjectVersion) hsc2hs
+BinDistShScripts = ghc-$(ProjectVersion) ghci-$(ProjectVersion) ghc-pkg-$(ProjectVersion) hsc2hs-ghc
 else
 BinDistShScripts =
 endif
@@ -214,7 +214,6 @@ endif
 BinDistPrlScripts = ghcprof
 BinDistLibPrlScripts = ghc-asm ghc-split
 BinDistBins = hp2ps runghc
-BinDistOptBins = runhaskell
 BinDistLinks = ghc ghci ghc-pkg
 BinDistLibSplicedFiles = package.conf
 BinDistDirs = includes compiler docs driver libraries rts utils
@@ -314,27 +313,23 @@ endif # XSLTPROC
 
 endif # BINDIST_DOC_WAYS
 
-binary-dist ::
 ifneq "$(DIR_DOCBOOK_XSL)" ""
-       @for i in $(BinDistDirs); do                            \
-         if test -d "$$i"; then                                \
-           $(MAKE) -C $$i $(MFLAGS) $(BINDIST_DOC_WAYS);       \
-           echo $(MAKE) -C $$i $(MFLAGS) install-docs XMLDocWays="$(BINDIST_DOC_WAYS)" \
-               prefix=$(BIN_DIST_DIR)  \
-               exec_prefix=$(BIN_DIST_DIR) \
-               bindir=$(BIN_DIST_DIR)/bin/$(TARGETPLATFORM) \
-               libdir=$(BIN_DIST_DIR)/lib/$(TARGETPLATFORM) \
-               libexecdir=$(BIN_DIST_DIR)/lib/$(TARGETPLATFORM) \
-               datadir=$(BIN_DIST_DIR)/share; \
-           $(MAKE) -C $$i $(MFLAGS) install-docs XMLDocWays="$(BINDIST_DOC_WAYS)" \
-               prefix=$(BIN_DIST_DIR)  \
-               exec_prefix=$(BIN_DIST_DIR) \
-               bindir=$(BIN_DIST_DIR)/bin/$(TARGETPLATFORM) \
-               libdir=$(BIN_DIST_DIR)/lib/$(TARGETPLATFORM) \
-               libexecdir=$(BIN_DIST_DIR)/lib/$(TARGETPLATFORM) \
-               datadir=$(BIN_DIST_DIR)/share; \
-         fi \
-       done
+.PHONY: binary-dist-doc-%
+
+BINARY_DIST_DOC_RULES=$(foreach d,$(BinDistDirs),binary-dist-doc-$d)
+
+binary-dist :: $(BINARY_DIST_DOC_RULES)
+
+$(BINARY_DIST_DOC_RULES): binary-dist-doc-%:
+       $(MAKE) -C $* $(MFLAGS) $(BINDIST_DOC_WAYS)
+       $(MAKE) -C $* $(MFLAGS) install-docs \
+               XMLDocWays="$(BINDIST_DOC_WAYS)" \
+               prefix=$(BIN_DIST_DIR) \
+               exec_prefix=$(BIN_DIST_DIR) \
+               bindir=$(BIN_DIST_DIR)/bin/$(TARGETPLATFORM) \
+               libdir=$(BIN_DIST_DIR)/lib/$(TARGETPLATFORM) \
+               libexecdir=$(BIN_DIST_DIR)/lib/$(TARGETPLATFORM) \
+               datadir=$(BIN_DIST_DIR)/share
 endif
 
 # Rename scripts to $i.prl and $i.sh where necessary.