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 # -----------------------------------------------------------------------------
77 Control/Concurrent_stub.$(way_)o
79 CLEAN_FILES += $(STUBOBJS) \
80 Control/Concurrent_stub.[ch]
82 #-----------------------------------------------------------------------------
83 # Building the library for GHCi
85 # The procedure differs from that in fptools/mk/target.mk in one way:
86 # (*) on Win32 we must split it into two, because a single .o file can't
87 # have more than 65536 relocations in it [due to a bug in the GNU
90 OBJECT_FILEFORMAT=unknown
91 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
94 ifeq "$(TARGETPLATFORM)" "i386-unknown-cygwin32"
98 ifeq "$(OBJECT_FILEFORMAT)" "PEi"
100 # Turn off standard rule which creates HSbase.o from LIBOBJS.
101 DONT_WANT_STD_GHCI_LIB_RULE=YES
103 GHCI_LIBOBJS = $(HS_OBJS)
105 INSTALL_LIBS += HSbase1.o HSbase2.o HSbase3.o
107 endif # OBJECT_FILEFORMAT = PEi
110 # -----------------------------------------------------------------------------
111 # Doc building with Haddock
113 EXCLUDED_HADDOCK_SRCS = \
114 GHC/PrimopWrappers.hs \
117 SRC_HADDOCK_OPTS += -t "Haskell Core Libraries (base package)" \
118 --no-implicit-prelude -p prologue.txt
120 # -----------------------------------------------------------------------------
122 include $(TOP)/mk/target.mk
124 ifeq "$(OBJECT_FILEFORMAT)" "PEi"
125 HSbase.o : $(GHCI_LIBOBJS)
126 $(LD) -r $(LD_X) -o HSbase1.o $(filter GHC/%, $(GHCI_LIBOBJS))
127 $(LD) -r $(LD_X) -o HSbase2.o $(filter Text/%, $(GHCI_LIBOBJS))
128 $(LD) -r $(LD_X) -o HSbase3.o $(filter-out GHC/% Text/%, $(GHCI_LIBOBJS))
130 endif # OBJECT_FILEFORMAT = PEi