1 #################################################################################
5 # Makefile for building the GHC Prelude libraries umpteen ways
8 #################################################################################
11 include $(TOP)/mk/boilerplate.mk
21 #-----------------------------------------------------------------------------
22 # Setting the standard variables
26 MKDEPENDHS = $(GHC_INPLACE)
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 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
38 LIBOBJS = $(filter-out PrelHugs.$(way_)o,$(HS_OBJS))
41 #-----------------------------------------------------------------------------
42 # Setting the GHC compile options
44 SRC_HC_OPTS += -recomp -cpp -fvia-C -fglasgow-exts $(GhcLibHcOpts) $(PACKAGE)
45 ifneq "$(DLLized)" "YES"
46 SRC_HC_OPTS += -static
49 ifdef USE_REPORT_PRELUDE
50 SRC_HC_OPTS += -DUSE_REPORT_PRELUDE=1
54 # Object and interface files have suffixes tagged with their ways
57 SRC_HC_OPTS += -hisuf $(way_)hi
60 #-----------------------------------------------------------------------------
61 # Dependency generation
63 SRC_MKDEPENDHS_OPTS += -I$(GHC_INCLUDE_DIR)
65 #-----------------------------------------------------------------------------
68 PrelGHC.$(way_)hi : PrelGHC.hi-boot
71 boot :: PrelGHC.hi $(foreach way, $(WAYS), PrelGHC.$(way)_hi)
73 DLL_DESCRIPTION="GHC-compiled Haskell Prelude"
75 ifeq "$(DLLized)" "YES"
76 HS_SRCS := $(filter-out PrelMain.lhs PrelHugs.lhs, $(HS_SRCS))
79 # PrelMain.dll_o isn't to be included in the final .a,
80 # but it needs to be generated
81 ifeq "$(DLLized)" "YES"
85 CLEAN_FILES += PrelGHC.hi $(foreach way, $(WAYS), PrelGHC.$(way)_hi)
88 # If we're building the unregisterised way, it may well be for Hugs.
89 # In that case, remember to bind the cbits objects into a single file
90 # which hugs can load as an auxiliary object file when loading the Prelude.
93 all :: libHSstd_cbits.u_o
94 CLEAN_FILES += libHSstd_cbits.u_o
96 $(RM) libHSstd_cbits.u_o
97 ld -r -o libHSstd_cbits.u_o cbits/*.o
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
119 ifeq "$(DLLized)" "YES"
120 INSTALL_DATAS := $(filter-out PrelHugs.$(way_)hi,$(INSTALL_DATAS))
123 include $(TOP)/mk/target.mk