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
40 ifdef USE_REPORT_PRELUDE
41 SRC_HC_OPTS += -DUSE_REPORT_PRELUDE=1
45 # Object and interface files have suffixes tagged with their ways
48 SRC_HC_OPTS += -hisuf $(way_)hi
52 PrelArrExtra_HC_OPTS += -monly-2-regs
54 # Far too much heap is needed to compile PrelNumExtra with -O at the
55 # moment, but there you go..
56 PrelNumExtra_HC_OPTS += -H24m -K2m
58 PrelPack_HC_OPTS += -K4m
59 PrelBase_HC_OPTS += -H12m
60 PrelRead_HC_OPTS += -H20m
61 PrelTup_HC_OPTS += -H12m -K2m
62 PrelNum_HC_OPTS += -H12m -K4m
63 PrelArr_HC_OPTS += -H8m
64 PrelHandle_HC_OPTS += -H20m
65 Time_HC_OPTS += -H24m -K2m
66 Complex_HC_OPTS += -H10m
69 Directory_HC_OPTS += -H8m
71 #-----------------------------------------------------------------------------
72 # Dependency generation
74 SRC_MKDEPENDHS_OPTS += -I$(GHC_INCLUDE_DIR)
76 #-----------------------------------------------------------------------------
79 PrelGHC.$(way_)hi : PrelGHC.hi-boot
82 boot :: PrelGHC.hi $(foreach way, $(WAYS), PrelGHC.$(way)_hi)
85 DLL_IMPLIB_NAME = libHS_imp.a
86 SRC_BLD_DLL_OPTS += --export-all --output-def=HSprel.def
87 SRC_BLD_DLL_OPTS += -lwinmm -lHSrts_imp -lHS_cbits_imp -lgmp -L. -L../../rts/gmp -L../../rts -Lcbits
91 HS_SRCS := $(filter-out PrelMain.lhs, $(HS_SRCS))
95 #-----------------------------------------------------------------------------
96 # Installation; need to install .hi files as well as libraries
98 # The interface files are put inside the $(libdir), since they
99 # might (potentially) be platform specific..
101 # override is used here because for binary distributions, datadir is
102 # set on the command line. sigh.
104 override datadir:=$(libdir)/imports/std
107 # Files to install from here
109 INSTALL_LIBS += $(LIBRARY)
110 ifeq "$(EnableWin32DLLs)" "YES"
111 INSTALL_PROGS += $(DLL_NAME)
112 INSTALL_LIBS += $(patsubst %.a, %_imp.a, $(LIBRARY)) PrelMain.o
113 INSTALL_DATAS += dLL_ifs.hi
115 INSTALL_DATAS += $(HS_IFACES)
117 include $(TOP)/mk/target.mk