[project @ 2003-01-29 10:28:56 by simonmar]
[ghc-hetmet.git] / ghc / rts / Makefile
index 37114fb..5281d13 100644 (file)
@@ -1,5 +1,4 @@
 #-----------------------------------------------------------------------------
-# $Id: Makefile,v 1.74 2002/08/09 20:59:41 sof Exp $
 #
 #  This is the Makefile for the runtime-system stuff.
 #  This stuff is written in C (and cannot be written in Haskell).
@@ -21,9 +20,7 @@ TOP=..
 # set of suffix rules for compiling C code, using $(HC) rather than $(CC)
 # and prepending "-optc" to $(CC_OPTS).  NB. must be done before including
 # boilerplate.mk below.
-ifneq "$(BootingFromHc)" "YES"
-UseGhcForCc = YES
-endif
+UseGhcForCc = $(shell if (test "x$(BootingFromHc)" = "xYES"); then echo NO; else echo YES; fi)
 
 include $(TOP)/mk/boilerplate.mk
 
@@ -149,6 +146,20 @@ MKDEPENDC_SRCS     = $(C_SRCS) $(HC_SRCS)
 SRC_MKDEPENDC_OPTS += -I. -I../includes
 
 # -----------------------------------------------------------------------------
+# The auto-generated apply code
+
+AUTO_APPLY = AutoApply.hc
+
+gen_apply : GenApply.hs
+       $(GHC) -o $@ -I$(GHC_INCLUDE_DIR) GenApply.hs 
+
+$(AUTO_APPLY): $(GHC_GENAPPLY)
+       @$(RM) $@
+       $(GHC_GENAPPLY) >$@
+
+EXTRA_SRCS += $(AUTO_APPLY)
+
+# -----------------------------------------------------------------------------
 #
 #  Building DLLs is only supported on mingw32 at the moment.
 #
@@ -180,6 +191,7 @@ endif
 # and not worth re-implementing in our Makefile framework.
 
 ifneq "$(HaveLibGmp)" "YES"
+ifneq "$(HaveFrameworkHaskellSupport)" "YES"
 ifneq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
 boot ::
        cd gmp && ./configure --enable-shared=no \
@@ -211,6 +223,7 @@ clean distclean maintainer-clean ::
 
 INSTALL_LIBS += gmp/libgmp.a
 endif
+endif
 
 gmp/libgmp.a ::
        $(MAKE) -C gmp MAKEFLAGS=