[project @ 1998-11-26 09:17:22 by sof]
[ghc-hetmet.git] / ghc / runtime / Makefile
index ff991b0..1126583 100644 (file)
@@ -1,5 +1,5 @@
 #-----------------------------------------------------------------------------
-# $Id: Makefile,v 1.4 1997/03/14 05:11:52 sof Exp $
+# $Id: Makefile,v 1.12 1998/08/15 14:06:48 sof Exp $
 
 #  This is the Makefile for the runtime-system stuff.
 #  This stuff is written in C (and cannot be written in Haskell).
@@ -29,6 +29,8 @@ TOP=..
 DoingRTS=YES
 include $(TOP)/mk/boilerplate.mk
 
+WAYS=$(GhcLibWays)
+
 #
 # A general rule for the grand mk setup is that in a build tree, only
 # directories that don't have any subdirs containing Makefiles are built
@@ -108,6 +110,7 @@ SRCS_RTS_LC = $(wildcard c-as-asm/*.lc) \
        main/RtsFlags.lc                \
        main/main.lc                    \
        prims/PrimArith.lc              \
+       prims/LongLong.lc               \
        prims/PrimMisc.lc               \
        profiling/CostCentre.lc         \
        profiling/Hashing.lc            \
@@ -140,8 +143,12 @@ SRCS_RTS_LC = $(wildcard c-as-asm/*.lc) \
 SRCS_RTS_LHC = $(wildcard main/*.lhc c-as-asm/*.lhc storage/*.lhc gum/*.lhc)
 
 HEADER_FILES = $(SRCS_RTS_LH:.lh=.h)
+
 C_SRCS = $(SRCS_RTS_LC:.lc=.c) $(SRCS_RTS_LHC:.lhc=.hc) $(SRCS_CLIB_LC:.lc=.c) $(HEADER_FILES)
 
+# To avoid having to redo these each time.
+.PRECIOUS : %.$(way_)hc
+
 #
 # Clean out header files when doing way `normal'
 #
@@ -156,12 +163,15 @@ LIBRARY = libHSrts$(_way).a
 LIBOBJS = $(patsubst %.lc,%.$(way_)o,$(SRCS_RTS_LC)) \
           $(patsubst %.lhc,%.$(way_)o,$(SRCS_RTS_LHC))
 
+SRC_HC_OPTS += -I$(GHC_INCLUDE_DIR) $(GCap) $(GC2s) $(GC1s) -O -optc-DIN_GHC_RTS=1 -I$(GHC_RUNTIME_DIR)/storage 
+
 #
-# dependencies
+# Note: _have_ to drop the -optc prefix for the GC-type opts (e.g. -optc-DGCap), since
+# -o<foo> is interpreted by mkdependC as meaning use <foo> as suffix.
 #
-SRC_HC_OPTS += -I$(GHC_INCLUDE_DIR) -O -optc-DIN_GHC_RTS=1 -I$(GHC_RUNTIME_DIR)/storage 
-
-SRC_MKDEPENDC_OPTS += $(GCap) $(GC2s) $(GC1s)
+# Hack: Include -D for all the different collectors to be sure we gather all the deps.
+#
+SRC_MKDEPENDC_OPTS += -I$(GHC_INCLUDE_DIR) -DGCap -DGC1s -DGC2s
 
 #-----------------------------------------------------------------------------
 # file-specific options 
@@ -204,9 +214,6 @@ CLEAN_FILES  += main/TopClosure.o
 INSTALL_LIBS += main/TopClosure.o
 endif
 
-
-
-
 #-----------------------------------------------------------------------------
 #
 # Files to install
@@ -232,10 +239,10 @@ endif
 
 gum/SysMan : gum/SysMan.mp_o gum/LLComms.mp_o main/Mallocs.o hooks/OutOfVM.o
        $(RM) $@
-       $(HC) $(HC_OPTS) -o $@ gum/SysMan.mp_o gum/LLComms.mp_o main/Mallocs.o hooks/OutOfVM.o -L$$PVM_ROOT/lib/$$PVM_ARCH -lpvm3 -lgpvm3 $(__socket_libs)
+       gcc -o $@ gum/SysMan.mp_o gum/LLComms.mp_o main/Mallocs.o hooks/OutOfVM.o -L$$PVM_ROOT/lib/$$PVM_ARCH -lpvm3 -lgpvm3 $(__socket_libs)
 
 CLEAN_FILES  += gum/SysMan.mp_o gum/SysMan
-INSTALL_LIBS += gum/SysMan
+INSTALL_LIBEXECS += gum/SysMan
 endif
 
 include $(TOP)/mk/target.mk