-# The auto-generated apply code
-
-# We want a slightly different version for the unregisterised way, so we make
-# AutoApply on a per-way basis (eg. AutoApply_p.cmm).
-
-ifneq "$(DOING_BIN_DIST)" "YES"
-
-AUTO_APPLY_CMM = AutoApply$(_way).cmm
-
-ifneq "$(BootingFromHc)" "YES"
-$(AUTO_APPLY_CMM): $(GHC_GENAPPLY)
- @$(RM) $@
- $(GENAPPLY) $(if $(filter $(way), u debug_u), -u) >$@
-endif
-
-EXTRA_CMM_SRCS += $(AUTO_APPLY_CMM)
-
-CLEAN_FILES += $(AUTO_APPLY_CMM)
-
-endif
-
-# -----------------------------------------------------------------------------
-
-# Need to get the GMP vars in through CPP to package.conf.in, and put
-# quotes around each element.
-
-empty =
-space = $(empty) $(empty)
-comma = ,
-PACKAGE_CPP_OPTS += -DGMP_INCLUDE_DIRS='$(subst $(space),$(comma),$(patsubst %,"%",$(strip $(GMP_INCLUDE_DIRS))))'
-PACKAGE_CPP_OPTS += -DGMP_LIB_DIRS='$(subst $(space),$(comma),$(patsubst %,"%",$(strip $(GMP_LIB_DIRS))))'
-
-ifneq "$(GMP_INCLUDE_DIRS)" ""
-SRC_HC_OPTS += -I$(GMP_INCLUDE_DIRS)
-SRC_CC_OPTS += -I$(GMP_INCLUDE_DIRS)
-SRC_HSC2HS_OPTS += -I$(GMP_INCLUDE_DIRS)
-endif
-ifneq "$(GMP_LIB_DIRS)" ""
-SRC_LD_OPTS += -L$(GMP_LIB_DIRS)
-endif
-
-SRC_CC_OPTS += -I../gmp/gmpbuild
-SRC_HC_OPTS += -I../gmp/gmpbuild
-SRC_HSC2HS_OPTS += -I../gmp/gmpbuild
-SRC_LD_OPTS += -L../gmp/gmpbuild
-
-#-----------------------------------------------------------------------------
-# libffi stuff
-
-SRC_CC_OPTS += -I../libffi/build/include
-SRC_HC_OPTS += -I../libffi/build/include
-SRC_HSC2HS_OPTS += -I../libffi/build/include
-SRC_LD_OPTS += -L../libffi/build/include
-
-#-----------------------------------------------------------------------------
-#
-# Building the GUM SysMan
-#
-
-ifeq "$(way)" "mp"
-all :: parallel/SysMan
-
-ifdef solaris2_TARGET_OS
-__socket_libs = -lsocket -lnsl
-else
-__socket_libs =
-endif
-
-parallel/SysMan : parallel/SysMan.mp_o parallel/LLComms.mp_o RtsUtils.mp_o RtsFlags.mp_o
- $(RM) $@
- gcc -o $@ parallel/SysMan.mp_o parallel/LLComms.mp_o -L$$PVM_ROOT/lib/$$PVM_ARCH -lgpvm3 -lpvm3 $(__socket_libs)
-
-CLEAN_FILES += parallel/SysMan.mp_o parallel/SysMan
-INSTALL_LIBEXECS += parallel/SysMan
-endif
-
-#-----------------------------------------------------------------------------
-# Compiling the cmm files
-
-# ToDo: should we really include Rts.h here? Required for GNU_ATTRIBUTE().
-SRC_HC_OPTS += -I.
-
-# Otherwise the stack-smash handler gets triggered.
-ifeq "$(TargetOS_CPP)" "openbsd"
-SRC_HC_OPTS += -optc-fno-stack-protector
-endif
-
-# -O3 helps unroll some loops (especially in copy() with a constant argument).
-sm/Evac_HC_OPTS += -optc-funroll-loops
-
-ifneq "$(findstring thr, $(way))" ""
-EXTRA_SRCS += sm/Evac_thr.c sm/Scav_thr.c
-CLEAN_FILES += sm/Evac_thr.c sm/Scav_thr.c
-
-sm/Evac_thr.c : sm/Evac.c
- cp $< $@
-sm/Scav_thr.c : sm/Scav.c
- cp $< $@
-
-sm/Evac_thr_HC_OPTS += -optc-DPARALLEL_GC
-sm/Scav_thr_HC_OPTS += -optc-DPARALLEL_GC
-else
-EXCLUDED_SRCS += sm/Evac_thr.c sm/Scav_thr.c
-endif
-
-# Without this, thread_obj will not be inlined (at least on x86 with GCC 4.1.0)
-sm/Compact_HC_OPTS += -optc-finline-limit=2500
-
-# -fno-strict-aliasing is required for the runtime, because we often
-# use a variety of types to represent closure pointers (StgPtr,
-# StgClosure, StgMVar, etc.), and without -fno-strict-aliasing gcc is
-# allowed to assume that these pointers do not alias. eg. without
-# this flag we get problems in sm/Evac.c:copy() with gcc 3.4.3, the
-# upd_evacee() assigments get moved before the object copy.
-SRC_CC_OPTS += -fno-strict-aliasing
-
-# We *want* type-checking of hand-written cmm.
-SRC_HC_OPTS += -dcmm-lint
-
-ifneq "$(BootingFromHc)" "YES"
-# .cmm files depend on all the .h files, to a first approximation.
-%.$(way_)o : %.cmm $(H_FILES)
- $(HC_PRE_OPTS)
- $(HC) $(HC_OPTS) -c $< -o $@
- $(HC_POST_OPTS)
-
-%.$(way_)hc : %.cmm $(H_FILES)
- $(HC) $(HC_OPTS) -C $< -o $@
-
-%.$(way_)s : %.cmm $(H_FILES)
- $(HC) $(HC_OPTS) -S $< -o $@
-endif
-
-#-----------------------------------------------------------------------------
-#
-# Files to install
-#
-# Just libHSrts is installed uniformly across ways
-#
-
-include $(TOP)/mk/target.mk
-
-ifeq "$(DYNAMIC_RTS) $(HOSTPLATFORM)" "YES i386-unknown-mingw32"
-# $(LIBRARY).a is not the static library libHSrts.a but
-# libHSrts.dll.a, the import library for dynamic linking required for
-# linking the dynamic version of base
-buildbase: $(LIBRARY).a
- $(MAKE) way="" -C ../libraries/ make.library.ghc-prim
- $(MAKE) way="" -C ../libraries/ make.library.integer-gmp
- $(MAKE) way="" -C ../libraries/ make.library.base
-endif
-
-#-----------------------------------------------------------------------------
-#
-# binary-dist
-
-BINDIST_EXTRAS += package.conf.in
-BINDIST_EXTRAS += $(INSTALL_LIBS)
-BINDIST_EXTRAS += $(INSTALL_LIBEXECS)
-
-# Setting _way here is a nasty hack to make sure we get libHSrts*.a etc
-# rather than just libHSrts.a when we are making bindists.
-binary-dist: _way=*