[project @ 2002-02-16 00:30:05 by sof]
[ghc-hetmet.git] / ghc / rts / Makefile
index 17b16ec..9240686 100644 (file)
@@ -1,5 +1,5 @@
 #-----------------------------------------------------------------------------
-# $Id: Makefile,v 1.62 2002/02/04 12:23:02 simonmar Exp $
+# $Id: Makefile,v 1.68 2002/02/14 17:17:08 sof Exp $
 #
 #  This is the Makefile for the runtime-system stuff.
 #  This stuff is written in C (and cannot be written in Haskell).
@@ -29,12 +29,20 @@ include $(TOP)/mk/boilerplate.mk
 
 HC=$(GHC_INPLACE)
 
-PACKAGE = rts
 WAYS=$(GhcLibWays)
 
+PACKAGE = rts
+
+# Tells the build system not to add various Haskellish options to $(SRC_HC_OPTS)
+NON_HS_PKG = YES
+
 # grab sources from these subdirectories
 ALL_DIRS = hooks parallel
 
+ifeq "$(HaveLibGmp)" "YES"
+PACKAGE_CPP_OPTS += -DHAVE_LIBGMP
+endif
+
 ifneq "$(DLLized)" "YES"
 EXCLUDED_SRCS += RtsDllMain.c
 else
@@ -45,9 +53,11 @@ EXCLUDED_SRCS += parallel/SysMan.c
 
 # The build system doesn't give us these
 HC_SRCS = $(filter %.hc, $(SRCS))
-HC_OBJS = $(patsubst %.hc,%.$(way)_o, $(HC_SRCS))
+HC_OBJS = $(patsubst %.hc,%.$(way_)o, $(HC_SRCS))
+
+CLEAN_FILES += $(HC_OBJS)
 
-# Override the default $(LIBOBJS) (the default provides for building Haskell libs)
+# Override the default $(LIBOBJS) (defaults to $(HS_OBJS))
 LIBOBJS = $(C_OBJS) $(HC_OBJS)
 
 SplitObjs=NO
@@ -75,13 +85,16 @@ WARNING_OPTS += -Wcast-align
 #WARNING_OPTS += -Wredundant-decls 
 #WARNING_OPTS += -Wconversion
 
+STANDARD_OPTS += -I../includes -I. -Iparallel
+# COMPILING_RTS is only used when building Win32 DLL support.
+STANDARD_OPTS += -DCOMPILING_RTS
+
 # HC_OPTS is included in both .c and .hc compilations, whereas CC_OPTS is
 # only included in .c compilations.  HC_OPTS included the WAY_* opts, which
 # must be included in both types of compilations.
 
 SRC_CC_OPTS += $(WARNING_OPTS)
-
-SRC_HC_OPTS += -I../includes -I. -Iparallel -DCOMPILING_RTS
+SRC_CC_OPTS += $(STANDARD_OPTS)
 
 SRC_CC_OPTS += $(GhcRtsCcOpts)
 SRC_HC_OPTS += $(GhcRtsHcOpts)