1 #################################################################################
5 # Makefile for building the GHC Prelude libraries umpteen ways
8 #################################################################################
11 include $(TOP)/mk/boilerplate.mk
21 #-----------------------------------------------------------------------------
22 # Setting the standard variables
25 LIBRARY = libHS$(_way).a
26 HS_SRCS = $(wildcard *.lhs)
27 HS_OBJS = $(HS_SRCS:.lhs=.$(way_)o)
29 HS_IFACES= $(HS_SRCS:.lhs=.$(way_)hi) PrelGHC.$(way_)hi
32 #-----------------------------------------------------------------------------
33 # Setting the GHC compile options
35 SRC_HC_OPTS += -recomp -cpp -fglasgow-exts -fvia-C -Rghc-timing $(GhcLibHcOpts) -fcompiling-prelude
37 SRC_HC_OPTS += -static
42 WAY_p_HC_OPTS += -GPrelude
43 WAY_mr_HC_OPTS += -GPrelude
46 # Object and interface files have suffixes tagged with their ways
49 SRC_HC_OPTS += -hisuf $(way_)hi
53 PrelArrExtra_HC_OPTS += -monly-2-regs
54 Directory_HC_OPTS += -monly-3-regs
55 Time_HC_OPTS += -monly-3-regs
57 # argh, adding USP seems to require extra heap... an extra 2 to 6MB,
58 # in fact, on each of these. (KSW 1998-12)
60 # Far too much heap is needed to compile PrelNumExtra with -O at the
61 # moment, but there you go..
62 PrelNumExtra_HC_OPTS += -H34m -K2m
64 PrelPack_HC_OPTS += -K4m
65 PrelBase_HC_OPTS += -H12m
66 PrelRead_HC_OPTS += -H20m
67 PrelTup_HC_OPTS += -H12m -K2m
68 PrelNum_HC_OPTS += -H12m -K4m
69 PrelArr_HC_OPTS += -H8m
70 PrelHandle_HC_OPTS += -H20m
71 Time_HC_OPTS += -H24m -K2m
72 Complex_HC_OPTS += -H10m
74 PrelMain_HC_OPTS += -fno-prune-tydecls # avoids an apparent bug; ToDo
76 Directory_HC_OPTS += -H8m
78 #-----------------------------------------------------------------------------
79 # Dependency generation
81 SRC_MKDEPENDHS_OPTS += -I$(GHC_INCLUDE_DIR)
83 #-----------------------------------------------------------------------------
86 PrelGHC.$(way_)hi : PrelGHC.hi-boot
89 boot :: PrelGHC.hi $(foreach way, $(WAYS), PrelGHC.$(way)_hi)
92 DLL_IMPLIB_NAME = libHS_imp.a
93 SRC_BLD_DLL_OPTS += --export-all --output-def=HSprel.def
94 SRC_BLD_DLL_OPTS += -lwinmm -lHSrts_imp -lHS_cbits_imp -lgmp -L. -L../../rts/gmp -L../../rts -Lcbits
98 HS_SRCS := $(filter-out PrelMain.lhs, $(HS_SRCS))
102 #-----------------------------------------------------------------------------
103 # Installation; need to install .hi files as well as libraries
105 # The interface files are put inside the $(libdir), since they
106 # might (potentially) be platform specific..
108 # override is used here because for binary distributions, datadir is
109 # set on the command line. sigh.
111 override datadir:=$(libdir)/imports/std
114 # Files to install from here
116 INSTALL_LIBS += $(LIBRARY)
117 INSTALL_DATAS += $(HS_IFACES)
119 include $(TOP)/mk/target.mk