1 #################################################################################
5 # Makefile for building the GHC Prelude libraries umpteen ways
8 #################################################################################
11 include $(TOP)/mk/boilerplate.mk
21 #-----------------------------------------------------------------------------
22 # Setting the standard variables
27 ifneq "$(DLLized)" "YES"
28 PACKAGE = -package-name std
30 # Hack by SPJ to delay if-then-else until the pattern rule when we have $*
31 PACKAGE = $(subst ~, ,$(word $(words dummy $(findstring $(notdir $*), PrelMain )), -package-name~std))
36 # we don't want PrelMain in the GHCi library.
37 GHCI_LIBOBJS = $(filter-out PrelMain.$(way_)o,$(HS_OBJS))
39 BOOT_SRCS += PrelPrimopWrappers.hs
41 #-----------------------------------------------------------------------------
42 # Setting the GHC compile options
44 SRC_HC_OPTS += -cpp -fvia-C -fglasgow-exts $(GhcLibHcOpts) $(PACKAGE)
46 SRC_HSC2HS_OPTS += -Icbits
48 ifdef USE_REPORT_PRELUDE
49 SRC_HC_OPTS += -DUSE_REPORT_PRELUDE=1
52 # ESSENTIAL, for getting reasonable performance from the I/O library:
53 PrelIOBase_HC_OPTS = -funbox-strict-fields
56 PrelIOBase_HC_OPTS += -fno-ignore-asserts
57 PrelHandle_HC_OPTS += -fno-ignore-asserts
58 PrelIO_HC_OPTS += -fno-ignore-asserts
61 PrelStorable_HC_OPTS = -monly-3-regs
62 PrelCError_HC_OPTS = +RTS -K4m -RTS
63 PrelInt_HC_OPTS = -monly-3-regs
64 PrelWord_HC_OPTS = -monly-3-regs
66 #-----------------------------------------------------------------------------
67 # Dependency generation
69 SRC_MKDEPENDHS_OPTS += -I$(GHC_INCLUDE_DIR)
71 #-----------------------------------------------------------------------------
74 PrelPrimopWrappers.hs: ../../compiler/prelude/primops.txt
75 rm -f PrelPrimopWrappers.hs
76 ../../utils/genprimopcode/genprimopcode --make-haskell-wrappers \
77 < ../../compiler/prelude/primops.txt > PrelPrimopWrappers.hs
79 PrelGHC.$(way_)hi : PrelGHC.hi-boot
82 boot :: PrelGHC.hi $(foreach way, $(WAYS), PrelGHC.$(way)_hi)
84 ifneq "$(BootingFromHc)" "YES"
85 boot :: PrelPrimopWrappers.hs
86 all :: PrelPrimopWrappers.hs
89 DLL_DESCRIPTION="GHC-compiled Haskell Prelude"
91 ifeq "$(DLLized)" "YES"
92 HS_SRCS := $(filter-out PrelMain.lhs, $(HS_SRCS))
93 # PrelMain.dll_o isn't to be included in the final .a,
94 # but it needs to be generated
98 CLEAN_FILES += PrelGHC.hi $(foreach way, $(WAYS), PrelGHC.$(way)_hi)
100 #-----------------------------------------------------------------------------
101 # Installation; need to install .hi files as well as libraries
103 # The interface files are put inside the $(libdir), since they
104 # might (potentially) be platform specific..
106 # override is used here because for binary distributions, datadir is
107 # set on the command line. sigh.
109 override datadir:=$(libdir)/imports/std
112 # Files to install from here
114 ifeq "$(DLLized)" "YES"
115 INSTALL_LIBS += PrelMain.dll_o
118 INSTALL_DATAS += PrelGHC.$(way_)hi
120 include $(TOP)/mk/target.mk