1 #################################################################################
5 # Makefile for building the GHC Prelude libraries umpteen ways
8 #################################################################################
11 include $(TOP)/mk/boilerplate.mk
21 #-----------------------------------------------------------------------------
22 # Setting the standard variables
28 ifneq "$(DLLized)" "YES"
29 PACKAGE = -package-name std
31 # Hack by SPJ to delay if-then-else until the pattern rule when we have $*
32 PACKAGE = $(subst ~, ,$(word $(words dummy $(findstring $(notdir $*), PrelMain )), -package-name~std))
37 # we don't want PrelMain in the GHCi library.
38 GHCI_LIBOBJS = $(filter-out PrelMain.$(way_)o,$(HS_OBJS))
40 #-----------------------------------------------------------------------------
41 # Setting the GHC compile options
43 SRC_HC_OPTS += -recomp -cpp -fvia-C -fglasgow-exts $(GhcLibHcOpts) $(PACKAGE)
44 ifneq "$(DLLized)" "YES"
45 SRC_HC_OPTS += -static
48 ifdef USE_REPORT_PRELUDE
49 SRC_HC_OPTS += -DUSE_REPORT_PRELUDE=1
53 # Object and interface files have suffixes tagged with their ways
56 SRC_HC_OPTS += -hisuf $(way_)hi
59 #-----------------------------------------------------------------------------
60 # Dependency generation
62 SRC_MKDEPENDHS_OPTS += -I$(GHC_INCLUDE_DIR)
64 #-----------------------------------------------------------------------------
67 PrelGHC.$(way_)hi : PrelGHC.hi-boot
70 boot :: PrelGHC.hi $(foreach way, $(WAYS), PrelGHC.$(way)_hi)
72 DLL_DESCRIPTION="GHC-compiled Haskell Prelude"
74 ifeq "$(DLLized)" "YES"
75 HS_SRCS := $(filter-out PrelMain.lhs PrelHugs.lhs, $(HS_SRCS))
78 # PrelMain.dll_o isn't to be included in the final .a,
79 # but it needs to be generated
80 ifeq "$(DLLized)" "YES"
84 CLEAN_FILES += PrelGHC.hi $(foreach way, $(WAYS), PrelGHC.$(way)_hi)
87 # If we're building the unregisterised way, it may well be for Hugs.
88 # In that case, remember to bind the cbits objects into a single file
89 # which hugs can load as an auxiliary object file when loading the Prelude.
92 all :: libHSstd_cbits.u_o
93 CLEAN_FILES += libHSstd_cbits.u_o
95 $(RM) libHSstd_cbits.u_o
96 ld -r -o libHSstd_cbits.u_o cbits/*.o
99 #-----------------------------------------------------------------------------
100 # Installation; need to install .hi files as well as libraries
102 # The interface files are put inside the $(libdir), since they
103 # might (potentially) be platform specific..
105 # override is used here because for binary distributions, datadir is
106 # set on the command line. sigh.
108 override datadir:=$(libdir)/imports/std
111 # Files to install from here
113 ifeq "$(DLLized)" "YES"
114 INSTALL_LIBS += PrelMain.dll_o
117 INSTALL_DATAS += PrelGHC.$(way_)hi
118 ifeq "$(DLLized)" "YES"
119 INSTALL_DATAS := $(filter-out PrelHugs.$(way_)hi,$(INSTALL_DATAS))
122 include $(TOP)/mk/target.mk