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 # If there is no system-supplied POSIX regex library, use our own
42 ifneq "$(HavePosixRegex)" "YES"
43 # Make sure we can get hold of regex.h
44 SRC_HC_OPTS += -Icbits/regex
45 SRC_HSC2HS_OPTS += -Icbits/regex
48 # -----------------------------------------------------------------------------
51 # ESSENTIAL, for getting reasonable performance from the I/O library:
52 SRC_HC_OPTS += -funbox-strict-fields
54 # -----------------------------------------------------------------------------
57 # These two lines are required for pre-processing ghc/compiler/prelude/primops.txt
58 SRC_CPP_OPTS += -I$(GHC_INCLUDE_DIR)
59 SRC_CPP_OPTS += ${GhcCppOpts}
61 ifeq "$(BootingFromHc)" "YES"
62 GHC/PrimopWrappers.hs:
63 touch GHC/PrimopWrappers.hs
65 GHC/PrimopWrappers.hs: $(GHC_COMPILER_DIR)/prelude/primops.txt
67 $(GHC_GENPRIMOP) --make-haskell-wrappers < $< > $@
70 boot :: GHC/PrimopWrappers.hs
72 EXTRA_SRCS += GHC/PrimopWrappers.hs
73 CLEAN_FILES += GHC/PrimopWrappers.hs
75 # -----------------------------------------------------------------------------
78 Control/Concurrent_stub.$(way_)o
80 CLEAN_FILES += $(STUBOBJS) \
81 Control/Concurrent_stub.[ch]
83 #-----------------------------------------------------------------------------
84 # Building the library for GHCi
86 # The procedure differs from that in fptools/mk/target.mk in one way:
87 # (*) on Win32 we must split it into two, because a single .o file can't
88 # have more than 65536 relocations in it [due to a bug in the GNU
91 OBJECT_FILEFORMAT=unknown
92 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
95 ifeq "$(TARGETPLATFORM)" "i386-unknown-cygwin32"
99 ifeq "$(OBJECT_FILEFORMAT)" "PEi"
101 # Turn off standard rule which creates HSbase.o from LIBOBJS.
102 DONT_WANT_STD_GHCI_LIB_RULE=YES
104 GHCI_LIBOBJS = $(HS_OBJS)
106 INSTALL_LIBS += HSbase1.o HSbase2.o HSbase3.o
108 endif # OBJECT_FILEFORMAT = PEi
111 # -----------------------------------------------------------------------------
112 # Doc building with Haddock
114 EXCLUDED_HADDOCK_SRCS = \
115 GHC/PrimopWrappers.hs \
118 SRC_HADDOCK_OPTS += -t "Haskell Core Libraries (base package)" \
119 --no-implicit-prelude -p prologue.txt
121 # -----------------------------------------------------------------------------
123 include $(TOP)/mk/target.mk
125 ifeq "$(OBJECT_FILEFORMAT)" "PEi"
126 HSbase.o : $(GHCI_LIBOBJS)
127 $(LD) -r $(LD_X) -o HSbase1.o $(filter GHC/%, $(GHCI_LIBOBJS))
128 $(LD) -r $(LD_X) -o HSbase2.o $(filter Text/%, $(GHCI_LIBOBJS))
129 $(LD) -r $(LD_X) -o HSbase3.o $(filter-out GHC/% Text/%, $(GHCI_LIBOBJS))
131 endif # OBJECT_FILEFORMAT = PEi