1 #################################################################################
5 # Makefile for building the GHC Prelude libraries umpteen ways
8 #################################################################################
11 include $(TOP)/mk/boilerplate.mk
17 ifeq ($(IncludeTestDirsInBuild),YES)
24 #-----------------------------------------------------------------------------
25 # Setting the standard variables
28 LIB_DIRS = ghc required glaExts concurrent
30 LIBRARY = libHS$(_way).a
31 HS_SRCS = $(foreach d, $(LIB_DIRS), $(wildcard $(d)/*.lhs))
32 HS_OBJS = $(HS_SRCS:.lhs=.$(way_)o)
34 HS_IFACES= $(HS_SRCS:.lhs=.$(way_)hi) ghc/GHC.$(way_)hi
37 #-----------------------------------------------------------------------------
38 # Setting the GHC compile options
40 SRC_HC_OPTS += -recomp -cpp -fglasgow-exts -fvia-C -Rghc-timing $(GhcLibHcOpts)
44 WAY_p_HC_OPTS += -GPrelude
45 WAY_mr_HC_OPTS += -GPrelude
48 # Object and interface files have suffixes tagged with their ways
51 SRC_HC_OPTS += -hisuf $(way_)hi
55 ghc/ArrBase_HC_OPTS += -monly-2-regs
56 glaExts/PackedString_HC_OPTS += -monly-3-regs
57 required/Directory_HC_OPTS += -monly-3-regs
58 concurrent/Parallel_HC_OPTS += -fglasgow-exts
59 required/Time_HC_OPTS += -monly-3-regs -H16m
61 # Far too much heap is needed to compile PrelNum with -O at the
62 # moment, but there you go..
63 ghc/PrelNum_HC_OPTS += -H30m
64 # Note: this option has to go in the Makefile rather than in an
65 # OPTIONS line in the source file. The reason being that we want
66 # to override the SRC_HC_OPTS of -O, and anything option coming
67 # from the Makefile overrides what's in OPTIONS lines. (mumble_HC_OPTS
68 # does override SRC_HC_OPTS settings)
69 ghc/Unsafe_HC_OPTS += -Onot
71 ghc/PrelBase_HC_OPTS += -H12m
72 ghc/PrelRead_HC_OPTS += -H12m
73 ghc/PrelTup_HC_OPTS += -H8m
74 ghc/ArrBase_HC_OPTS += -H8m
75 ghc/IOHandle_HC_OPTS += -H12m
76 required/Time_HC_OPTS += -H8m
77 required/Complex_HC_OPTS += -H10m
78 glaExts/Int_HC_OPTS += -H8m
79 glaExts/Word_HC_OPTS += -H8m
81 #-----------------------------------------------------------------------------
82 # Dependency generation
84 SRC_MKDEPENDHS_OPTS += -ighc:required:glaExts:concurrent -I$(GHC_INCLUDE_DIR)
86 #-----------------------------------------------------------------------------
89 ghc/GHC.$(way_)hi : ghc/GHC.hi-boot
92 boot :: ghc/GHC.hi $(foreach way, $(WAYS), ghc/GHC.$(way)_hi)
94 #-----------------------------------------------------------------------------
95 # Installation; need to install .hi files as well as libraries
97 # The interface files are put inside the $(libdir), since they
98 # might (potentially) be platform specific..
100 # Note: we use `override' here to ignore the setting of datadir
101 # which may have been set on the command-line..naughty, as it
102 # prevents `datadir' from being used from the command-line.
103 # This only applies to binary-distributions, though.n
105 ifeq "$(BIN_DIST)" "1"
106 override datadir:=$(libdir)/imports
108 datadir:=$(libdir)/imports
112 # Files to install from here
114 INSTALL_LIBS += $(LIBRARY)
115 INSTALL_DATAS += $(HS_IFACES)
117 include $(TOP)/mk/target.mk