-BinDistDirs = includes compiler docs rts
-
-BIN_DIST_TARBALL=ghc-$(ProjectVersion)-$(TARGETPLATFORM).tar.bz2
-
-BIN_DIST_TOP= distrib/Makefile \
- distrib/configure-bin.ac \
- distrib/INSTALL \
- distrib/README \
- ANNOUNCE \
- LICENSE \
- install-sh \
- config.guess \
- config.sub \
- aclocal.m4
-
-ifeq "$(darwin_TARGET_OS)" "1"
-BIN_DIST_TOP+=mk/fix_install_names.sh
-endif
-
-.PHONY: binary-dist-pre% binary-dist binary-pack
-
-binary-dist:: binary-dist-pre
-
-binary-dist-pre::
- -rm -rf $(BIN_DIST_DIR)
- -$(RM) $(BIN_DIST_DIR).tar.gz
- $(MKDIRHIER) $(BIN_DIST_DIR)/mk
- echo 'include $$(TOP)/Makefile-vars' > $(BIN_DIST_DIR)/mk/boilerplate.mk
- echo 'include $$(TOP)/mk/install.mk' > $(BIN_DIST_DIR)/mk/target.mk
- echo 'include $$(TOP)/mk/recurse.mk' >> $(BIN_DIST_DIR)/mk/target.mk
- echo '' > $(BIN_DIST_DIR)/mk/compat.mk
- cp mk/package.mk $(BIN_DIST_DIR)/mk/
- cp mk/install.mk $(BIN_DIST_DIR)/mk/
- cp mk/recurse.mk $(BIN_DIST_DIR)/mk/
- $(MKDIRHIER) $(BIN_DIST_DIR)/lib/$(TARGETPLATFORM)
- $(MKDIRHIER) $(BIN_DIST_DIR)/share
-
-binary-dist::
- $(MAKE) -C includes binary-dist DOING_BIN_DIST=YES
- $(MAKE) -C compiler binary-dist DOING_BIN_DIST=YES $(INSTALL_STAGE)
- # XXX $(MAKE) -C docs binary-dist DOING_BIN_DIST=YES
- $(MAKE) -C rts binary-dist DOING_BIN_DIST=YES
- $(MAKE) -C driver binary-dist DOING_BIN_DIST=YES
- $(MAKE) -C utils binary-dist DOING_BIN_DIST=YES
-
-VARFILE=$(BIN_DIST_DIR)/Makefile-vars.in
-
-binary-dist::
- @for i in $(BIN_DIST_TOP); do \
- if test -f "$$i"; then \
- echo cp $$i $(BIN_DIST_DIR); \
- cp $$i $(BIN_DIST_DIR); \
- fi; \
- done;
- @echo "Configuring the Makefile for this project..."
- echo > $(VARFILE)
- echo "package = ghc" >> $(VARFILE)
- echo "version = $(ProjectVersion)" >> $(VARFILE)
- echo "ProjectVersion = $(ProjectVersion)" >> $(VARFILE)
- echo "HaveLibGmp = $(HaveLibGmp)" >> $(VARFILE)
- echo "GhcLibsWithUnix = $(GhcLibsWithUnix)" >> $(VARFILE)
- echo "GhcWithInterpreter = $(GhcWithInterpreter)" >> $(VARFILE)
- echo "GhcHasReadline = $(GhcHasReadline)" >> $(VARFILE)
- echo "BootingFromHc = $(BootingFromHc)" >> $(VARFILE)
- cat distrib/Makefile-bin-vars.in >> $(VARFILE)
- @echo "Generating a shippable configure script.."
- $(MV) $(BIN_DIST_DIR)/configure-bin.ac $(BIN_DIST_DIR)/configure.ac
- ( cd $(BIN_DIST_DIR); autoreconf )
-
-ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
-binary-dist::
- $(MKDIRHIER) $(BIN_DIST_DIR)/icons
- cp distrib/hsicon.ico $(BIN_DIST_DIR)/icons
-endif
-
-#
-# binary dist'ing the documentation.
-# The default documentation to build/install is given below; overrideable
-# via build.mk or the 'make' command-line.
-#
-# If BINDIST_DOC_WAYS is set, use that
-# If XMLDocWays is set, use that
-# Otherwise, figure out what we can build based on configure results
-
-ifndef BINDIST_DOC_WAYS