-ifeq "$(darwin_TARGET_OS)" "1"
-BIN_DIST_TOP+=mk/fix_install_names.sh
-endif
-
-.PHONY: binary-dist-pre% binary-dist binary-pack
-
-BINARY_DIST_PRE_RULES=$(foreach d,$(BinDistDirs),binary-dist-pre-$d)
-
-binary-dist:: binary-dist-pre $(BINARY_DIST_PRE_RULES)
-
-binary-dist-pre::
- -rm -rf $(BIN_DIST_DIR)
- -$(RM) $(BIN_DIST_DIR).tar.gz
- $(MKDIRHIER) $(BIN_DIST_DIR)/bin/$(TARGETPLATFORM)
- $(MKDIRHIER) $(BIN_DIST_DIR)/lib/$(TARGETPLATFORM)
- $(MKDIRHIER) $(BIN_DIST_DIR)/share
-
-$(BINARY_DIST_PRE_RULES): binary-dist-pre-%:
- $(MAKE) -C $* $(MFLAGS) $(INSTALL_STAGE) install \
- 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
-
-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 "PACKAGE_SH_SCRIPTS = $(BinDistShScripts)" >> $(VARFILE)
- echo "PACKAGE_PRL_SCRIPTS = $(BinDistPrlScripts)" >> $(VARFILE)
- echo "PACKAGE_LIB_PRL_SCRIPTS = $(BinDistLibPrlScripts)" >> $(VARFILE)
- echo "PACKAGE_LIB_SPLICED_FILES = $(BinDistLibSplicedFiles)" >> $(VARFILE)
- echo "PACKAGE_BINS = $(BinDistBins)" >> $(VARFILE)
- echo "PACKAGE_OPT_BINS = $(BinDistOptBins)" >> $(VARFILE)
- echo "PACKAGE_LINKS = $(BinDistLinks)" >> $(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); autoconf )
-
-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