2 include $(TOP)/mk/boilerplate.mk
4 # -----------------------------------------------------------------------------
6 SUBDIRS = cbits include
31 Text/ParserCombinators \
38 SRC_HC_OPTS += -fglasgow-exts -cpp -Iinclude -\#include HsBase.h
39 SRC_HSC2HS_OPTS += -Iinclude -I$(FPTOOLS_TOP)/ghc/includes
41 # Make sure we can get hold of regex.h
42 ifneq "$(HavePosixRegex)" "YES"
43 SRC_HC_OPTS += -Icbits/regex
44 SRC_HSC2HS_OPTS += -Icbits/regex
47 # -----------------------------------------------------------------------------
50 # ESSENTIAL, for getting reasonable performance from the I/O library:
51 SRC_HC_OPTS += -funbox-strict-fields
53 # -----------------------------------------------------------------------------
56 # These two lines are required for pre-processing ghc/compiler/prelude/primops.txt
57 SRC_CPP_OPTS += -I$(GHC_INCLUDE_DIR)
58 SRC_CPP_OPTS += ${GhcCppOpts}
60 ifeq "$(BootingFromHc)" "YES"
61 GHC/PrimopWrappers.hs:
62 touch GHC/PrimopWrappers.hs
64 GHC/PrimopWrappers.hs: $(GHC_COMPILER_DIR)/prelude/primops.txt
66 $(GHC_GENPRIMOP) --make-haskell-wrappers < $< > $@
69 boot :: GHC/PrimopWrappers.hs
71 EXTRA_SRCS += GHC/PrimopWrappers.hs
72 CLEAN_FILES += GHC/PrimopWrappers.hs
74 #-----------------------------------------------------------------------------
75 # Building the library for GHCi
77 # The procedure differs from that in fptools/mk/target.mk in one way:
78 # (*) on Win32 we must split it into two, because a single .o file can't
79 # have more than 65536 relocations in it [due to a bug in the GNU
82 OBJECT_FILEFORMAT=unknown
83 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
86 ifeq "$(TARGETPLATFORM)" "i386-unknown-cygwin32"
90 ifeq "$(OBJECT_FILEFORMAT)" "PEi"
92 # Turn off standard rule which creates HSbase.o from LIBOBJS.
93 DONT_WANT_STD_GHCI_LIB_RULE=YES
95 GHCI_LIBOBJS = $(HS_OBJS)
97 INSTALL_LIBS += HSbase1.o HSbase2.o HSbase3.o
99 endif # OBJECT_FILEFORMAT = PEi
102 # -----------------------------------------------------------------------------
103 # Doc building with Haddock
105 EXCLUDED_HADDOCK_SRCS = \
106 GHC/PrimopWrappers.hs \
109 SRC_HADDOCK_OPTS += -t "Haskell Core Libraries (base package)" \
110 --no-implicit-prelude -p prologue.txt
112 # -----------------------------------------------------------------------------
114 include $(TOP)/mk/target.mk
116 ifeq "$(OBJECT_FILEFORMAT)" "PEi"
117 HSbase.o : $(GHCI_LIBOBJS)
118 $(LD) -r $(LD_X) -o HSbase1.o $(filter GHC/%, $(GHCI_LIBOBJS))
119 $(LD) -r $(LD_X) -o HSbase2.o $(filter Text/%, $(GHCI_LIBOBJS))
120 $(LD) -r $(LD_X) -o HSbase3.o $(filter-out GHC/% Text/%, $(GHCI_LIBOBJS))
122 endif # OBJECT_FILEFORMAT = PEi