endif
stage1 : $(GCC_LIB_DEP) check-packages
+ $(MAKE) -C utils mostlyclean
$(MAKE) -C utils/mkdependC boot
@case '${MFLAGS}' in *-[ik]*) x_on_err=0;; *-r*[ik]*) x_on_err=0;; *) x_on_err=1;; esac; \
for i in $(SUBDIRS_BUILD); do \
$(MAKE) -C libraries boot
$(MAKE) -C libraries all
+# When making distributions (i.e., whether with binary-dist or using the
+# vanilla install target to create an installer package), 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 explicitly build a second version with the stage 1
+# compiler of all utils that get installed and of all extra support binaries
+# includes in binary dists.
stage2 : check-packages
+ $(MAKE) -C utils mostlyclean
+ $(MAKE) -C utils stage=2
$(MAKE) -C compiler boot stage=2
$(MAKE) -C compiler stage=2
+ $(RM) -f libraries/ifBuildable/ifBuildable
+ $(MAKE) -C libraries stage=2 ifBuildable/ifBuildable
+ $(RM) -f libraries/installPackage/installPackage
+ $(MAKE) -C libraries stage=2 installPackage/installPackage
+
stage3 : check-packages
$(MAKE) -C compiler boot stage=3
-rm -rf $(BIN_DIST_DIR)
-$(RM) $(BIN_DIST_TARBALL)
-# 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
-
ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
binary-dist::
-$(RM) -rf installPackage
mkdir installPackage
$(CP) installPackage.hs installPackage/
-ifeq "$(UseStage1)" "YES"
+ifeq "$(stage)" "2"
cd installPackage && ../$(HC) -Wall -cpp \
--make installPackage -o installPackage \
$(BOOTSTRAP_INC_1_UP)
-$(RM) -rf ifBuildable
mkdir ifBuildable
$(CP) ifBuildable.hs ifBuildable/
-ifeq "$(UseStage1)" "YES"
+ifeq "$(stage)" "2"
cd ifBuildable && ../$(HC) -Wall --make ifBuildable -o ifBuildable
else
cd ifBuildable && $(GHC) -Wall --make ifBuildable -o ifBuildable
# installed for this GHC version. They are bound to be incompatible
# with the packages we built in the tree.
+ifeq "$(stage)" "2"
+ UseStage1 = YES
+endif
ifneq "$(findstring YES, $(UseStage1) $(BootingFromHc))" ""
# We are using the stage1 compiler to compile Haskell code, set up
EXCLUDE_SRCS += CRT_noglob.c
NOGLOB_O = CRT_noglob.o
else
+
+# We have two version: the inplace version compiled by the bootstrap compiler
+# and the install version compiled by the stage 1 compiler
+ifeq "$(stage)" "2"
HS_PROG = ghc-pkg.bin
+else
+HS_PROG = ghc-pkg-inplace.bin
+endif
INSTALL_LIBEXECS += $(HS_PROG)
NOGLOB_O =
+
endif
# -----------------------------------------------------------------------------
TOP=../..
include $(TOP)/mk/boilerplate.mk
-HS_PROG = hasktags
+# We have two version: the inplace version compiled by the bootstrap compiler
+# and the install version compiled by the stage 1 compiler
+ifeq "$(stage)" "2"
+HS_PROG = hasktags
+else
+HS_PROG = hasktags-inplace
+endif
CLEAN_FILES += Main.hi
TOP=../..
include $(TOP)/mk/boilerplate.mk
+# We have two version: the inplace version compiled by the bootstrap compiler
+# and the install version compiled by the stage 1 compiler
+ifeq "$(stage)" "2"
HS_PROG = hpc$(exeext)
+else
+HS_PROG = hpc-inplace$(exeext)
+endif
INSTALL_PROGS += $(HS_PROG)
HPC_LIB = $(TOP)/libraries/hpc
# we must also build with $(GhcHcOpts) here:
SRC_HC_OPTS += $(GhcHcOpts) $(GhcStage1HcOpts)
-HS_PROG = hsc2hs-bin
+# We have two version: the inplace version compiled by the bootstrap compiler
+# and the install version compiled by the stage 1 compiler
+ifeq "$(stage)" "2"
+HS_PROG = hsc2hs.bin
+else
+HS_PROG = hsc2hs-inplace.bin
+endif
+
ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
HS_PROG = hsc2hs$(exeext)
endif
TOP=../..
include $(TOP)/mk/boilerplate.mk
-HS_PROG=pwd
+# We have two version: the inplace version compiled by the bootstrap compiler
+# and the install version compiled by the stage 1 compiler
+ifeq "$(stage)" "2"
+HS_PROG = pwd
+else
+HS_PROG = pwd-inplace
+endif
binary-dist:
$(INSTALL_DIR) $(BIN_DIST_DIR)/utils/pwd
TOP=../..
include $(TOP)/mk/boilerplate.mk
-HS_PROG = runghc$(exeext)
+# We have two version: the inplace version compiled by the bootstrap compiler
+# and the install version compiled by the stage 1 compiler
+ifeq "$(stage)" "2"
+HS_PROG = runghc$(exeext)
+else
+HS_PROG = runghc-inplace$(exeext)
+endif
INSTALL_PROGS += $(HS_PROG)
UseGhcForCc = YES