[project @ 2001-05-18 16:54:04 by simonmar]
[ghc-hetmet.git] / ghc / lib / std / Makefile
index 8187ebc..420573c 100644 (file)
@@ -22,8 +22,7 @@ endif
 #      Setting the standard variables
 #
 
-HC      = $(GHC_INPLACE)
-CC      = $(GHC_INPLACE)
+HC = $(GHC_INPLACE)
 
 ifneq "$(DLLized)" "YES"
 PACKAGE = -package-name std
@@ -37,22 +36,32 @@ HSLIB = std
 # we don't want PrelMain in the GHCi library.
 GHCI_LIBOBJS = $(filter-out PrelMain.$(way_)o,$(HS_OBJS))
 
-HSC_SRCS = $(wildcard *.hsc)
-HSC_HS   = $(patsubst %.hsc,%.hs, $(HSC_SRCS))
-HS_SRCS := $(HSC_HS) $(filter-out $(HSC_HS),$(HS_SRCS))
+BOOT_SRCS += PrelPrimopWrappers.hs
 
 #-----------------------------------------------------------------------------
 #      Setting the GHC compile options
 
 SRC_HC_OPTS += -cpp -fvia-C -fglasgow-exts $(GhcLibHcOpts) $(PACKAGE)
 
+SRC_HSC2HS_OPTS += -Icbits
+
 ifdef USE_REPORT_PRELUDE
 SRC_HC_OPTS += -DUSE_REPORT_PRELUDE=1
 endif
 
+# ESSENTIAL, for getting reasonable performance from the I/O library:
+PrelIOBase_HC_OPTS   = -funbox-strict-fields 
+
+# debugging...
+PrelIOBase_HC_OPTS   += -fno-ignore-asserts
+PrelHandle_HC_OPTS   += -fno-ignore-asserts
+PrelIO_HC_OPTS       += -fno-ignore-asserts
+
 # Special options
 PrelStorable_HC_OPTS = -monly-3-regs
-PrelCError_HC_OPTS = +RTS -K4m -RTS
+PrelCError_HC_OPTS   = +RTS -K4m -RTS
+PrelInt_HC_OPTS      = -monly-3-regs
+PrelWord_HC_OPTS     = -monly-3-regs
 
 #-----------------------------------------------------------------------------
 #      Dependency generation
@@ -70,8 +79,12 @@ PrelPrimopWrappers.hs: ../../compiler/prelude/primops.txt
 PrelGHC.$(way_)hi      : PrelGHC.hi-boot
        cp $< $@
 
-boot :: PrelPrimopWrappers.hs PrelGHC.hi $(foreach way, $(WAYS), PrelGHC.$(way)_hi)
-all :: PrelPrimopWrappers.hs
+boot :: PrelGHC.hi $(foreach way, $(WAYS), PrelGHC.$(way)_hi)
+
+ifneq "$(BootingFromHc)" "YES"
+boot :: PrelPrimopWrappers.hs
+all  :: PrelPrimopWrappers.hs
+endif
 
 DLL_DESCRIPTION="GHC-compiled Haskell Prelude"
 
@@ -82,12 +95,7 @@ HS_SRCS := $(filter-out PrelMain.lhs, $(HS_SRCS))
 all :: PrelMain.dll_o
 endif
 
-CLEAN_FILES += PrelPrimopWrappers.hs PrelGHC.hi $(foreach way, $(WAYS), PrelGHC.$(way)_hi)
-
-CLEAN_FILES +=  \
-       $(patsubst %.hsc, %.hs, $(HSC_SRCS)) \
-       $(patsubst %.hsc, %.hs.c, $(HSC_SRCS)) \
-       $(patsubst %.hsc, %.hs.h, $(HSC_SRCS))
+CLEAN_FILES += PrelGHC.hi $(foreach way, $(WAYS), PrelGHC.$(way)_hi)
 
 #-----------------------------------------------------------------------------
 #      Installation; need to install .hi files as well as libraries