-# Installing
-
-# We want to install the stage 2 bootstrapped compiler by default, but we let
-# the user override this by saying 'make install stage=1', for example.
-ifeq "$(stage)" ""
-INSTALL_STAGE = stage=2
-else
-INSTALL_STAGE =
-endif
-
-install-strip:
- $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
-
-# Same as default rule, but we pass $(INSTALL_STAGE) to $(MAKE) too
-install :: check-packages
- @case '${MFLAGS}' in *-[ik]*) x_on_err=0;; *-r*[ik]*) x_on_err=0;; *) x_on_err=1;; esac; \
- for i in $(SUBDIRS); do \
- echo "------------------------------------------------------------------------"; \
- echo "== $(MAKE) $@ $(MFLAGS);"; \
- echo " in $(shell pwd)/$$i"; \
- echo "------------------------------------------------------------------------"; \
- $(MAKE) --no-print-directory -C $$i $(INSTALL_STAGE) $(MFLAGS) $@; \
- if [ $$? -eq 0 -o $$x_on_err -eq 0 ] ; then true; else exit 1; fi; \
- done
-
-ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
-# These files need to be in the InstallShield
-# INSTALL_DATAS rather than INSTALL_DOCS is used so these files go
-# in the top-level directory of the distribution
-INSTALL_DATAS += ANNOUNCE LICENSE README
-endif
-
-# If installing on Windows with MinGW32, copy the gcc compiler, headers and libs
-# and the perl interpreter and dll into the GHC prefix directory.
-# Gcc and Perl source locations derived from configuration data.
-ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
-ifneq "$(WhatGccIsCalled)" ""
-install ::
- -mkdir $(prefix)/gcc-lib
- -mkdir $(prefix)/include
- -mkdir $(prefix)/include/mingw
- -cp -rp $(GccDir)../include/* $(prefix)/include/mingw
- -cp -rp $(GccDir)../lib/gcc-lib/mingw32/$(GccVersion)/* $(prefix)/gcc-lib
- -cp -rp $(GccDir)../lib/gcc/mingw32/$(GccVersion)/* $(prefix)/gcc-lib
- -cp -rp $(GccDir)../libexec/gcc/mingw32/$(GccVersion)/* $(prefix)/gcc-lib
- -cp $(GccDir)../lib/*.* $(prefix)/gcc-lib
- -cp $(GccDir)gcc.exe $(prefix)
- -cp $(GccDir)as.exe $(prefix)/gcc-lib
- -cp $(GccDir)ld.exe $(prefix)/gcc-lib
- -cp $(GccDir)dllwrap.exe $(prefix)/gcc-lib
- -cp $(GccDir)dlltool.exe $(prefix)/gcc-lib
- -cp $(GhcDir)../perl.exe $(prefix)
- -cp $(GhcDir)../perl56.dll $(prefix)
-endif
-endif
-
-# Install gcc-extra-opts
-install ::
- $(INSTALL_DIR) $(DESTDIR)$(libdir)
- $(INSTALL_DATA) $(INSTALL_OPTS) extra-gcc-opts $(DESTDIR)$(libdir)
-
-install-docs ::
- @case '${MFLAGS}' in *-[ik]*) x_on_err=0;; *-r*[ik]*) x_on_err=0;; *) x_on_err=1;; esac; \
- for i in $(SUBDIRS); do \
- echo "------------------------------------------------------------------------"; \
- echo "== $(MAKE) $@ $(MFLAGS);"; \
- echo " in $(shell pwd)/$$i"; \
- echo "------------------------------------------------------------------------"; \
- $(MAKE) --no-print-directory -C $$i $(INSTALL_STAGE) $(MFLAGS) $@; \
- if [ $$? -eq 0 -o $$x_on_err -eq 0 ] ; then true; else exit 1; fi; \
- done
-
-# -----------------------------------------------------------------------------
-# Making a binary distribution
-#
-# `dist' `binary-dist'
-# Create a distribution tar file for this program. The tar file
-# should be set up so that the file names in the tar file start with
-# a subdirectory name which is the name of the package it is a
-# distribution for. This name can include the version number.
-#
-# For example, the distribution tar file of GCC version 1.40 unpacks
-# into a subdirectory named `gcc-1.40'.
-#
-# The easiest way to do this is to create a subdirectory
-# appropriately named, use ln or cp to install the proper files in
-# it, and then tar that subdirectory.
-#
-# The dist target should explicitly depend on all non-source files
-# that are in the distribution, to make sure they are up to date in
-# the distribution. See Making Releases.
-#
-# binary-dist is a GHC addition for binary distributions
-#
-
-binary-dist::
- -rm -rf $(BIN_DIST_DIR)
- -$(RM) $(BIN_DIST_DIR).tar.gz
-
-# When making bindists, we can have problems if some things (e.g. ghc-pkg)
-# are compiled with the bootstrapping compiler and some (e.g. the stage 2
-# compiler) with the stage1 compiler. See #1860 for an example.
-# Thus we rebuild the utils with stage 1 here. This is a bit unpleasant,
-# as binary-dist really shouldn't actually build anything, but it works.
-# We need to do the same for utilities used during library package installation.
-binary-dist::
- $(MAKE) -C utils clean
- $(MAKE) -C utils UseStage1=YES boot
- $(MAKE) -C utils UseStage1=YES
- $(RM) -f libraries/ifBuildable/ifBuildable
- $(MAKE) -C libraries UseStage1=YES ifBuildable/ifBuildable
- $(RM) -f libraries/installPackage/installPackage
- $(MAKE) -C libraries UseStage1=YES installPackage/installPackage