2 include $(TOP)/mk/boilerplate.mk
4 # -----------------------------------------------------------------------------
6 SUBDIRS = cbits include
32 Text/ParserCombinators \
39 SRC_HC_OPTS += -fglasgow-exts -cpp -Iinclude -"\#include" HsBase.h
40 SRC_HSC2HS_OPTS += -Iinclude -I$(FPTOOLS_TOP)/ghc/includes
42 # If there is no system-supplied POSIX regex library, use our own
43 ifneq "$(HavePosixRegex)" "YES"
44 # Make sure we can get hold of regex.h
45 SRC_HC_OPTS += -Icbits/regex
46 SRC_HSC2HS_OPTS += -Icbits/regex
49 # -----------------------------------------------------------------------------
52 # ESSENTIAL, for getting reasonable performance from the I/O library:
53 SRC_HC_OPTS += -funbox-strict-fields
55 # -----------------------------------------------------------------------------
58 # These two lines are required for pre-processing ghc/compiler/prelude/primops.txt
59 SRC_CPP_OPTS += -I$(GHC_INCLUDE_DIR)
60 SRC_CPP_OPTS += ${GhcCppOpts}
62 ifeq "$(BootingFromHc)" "YES"
63 GHC/PrimopWrappers.hs:
64 touch GHC/PrimopWrappers.hs
66 GHC/PrimopWrappers.hs: $(GHC_COMPILER_DIR)/prelude/primops.txt
68 $(GHC_GENPRIMOP) --make-haskell-wrappers < $< > $@
71 boot :: GHC/PrimopWrappers.hs
73 EXTRA_SRCS += GHC/PrimopWrappers.hs
74 CLEAN_FILES += GHC/PrimopWrappers.hs
76 # -----------------------------------------------------------------------------
77 ifneq "$(BootingFromHc)" "YES"
79 Control/Concurrent_stub.$(way_)o
81 CLEAN_FILES += $(STUBOBJS) \
82 Control/Concurrent_stub.[ch]
85 #-----------------------------------------------------------------------------
86 # Building the library for GHCi
88 # The procedure differs from that in fptools/mk/target.mk in one way:
89 # (*) on Win32 we must split it into two, because a single .o file can't
90 # have more than 65536 relocations in it [due to a bug in the GNU
93 OBJECT_FILEFORMAT=unknown
94 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
97 ifeq "$(TARGETPLATFORM)" "i386-unknown-cygwin32"
101 ifeq "$(OBJECT_FILEFORMAT)" "PEi"
103 # Turn off standard rule which creates HSbase.o from LIBOBJS.
104 DONT_WANT_STD_GHCI_LIB_RULE=YES
106 GHCI_LIBOBJS = $(HS_OBJS)
108 INSTALL_LIBS += HSbase1.o HSbase2.o HSbase3.o
110 endif # OBJECT_FILEFORMAT = PEi
113 # -----------------------------------------------------------------------------
114 # Doc building with Haddock
116 EXCLUDED_HADDOCK_SRCS = \
117 GHC/PrimopWrappers.hs \
120 SRC_HADDOCK_OPTS += -t "Haskell Hierarchical Libraries ($(PACKAGE) package)" \
121 --no-implicit-prelude
123 # -----------------------------------------------------------------------------
125 GHC/ForeignPtr.o Data/Array/IO/Internals.o Data/Array/Base.o \
126 Data/Generics/Instances.o Data/Complex.o Data/Array.o Data/STRef.o \
127 Data/Dynamic.o Data/Typeable.o Data/PackedString.o System/Mem/Weak.o \
128 System/Mem/StableName.o System/Posix/Types.o Control/Monad/ST.o \
129 Control/Exception.o Foreign/C/Types.o Foreign/ForeignPtr.o: include/Typeable.h
131 System/Posix/Types.o Foreign/C/Types.o: include/CTypes.h
133 # -----------------------------------------------------------------------------
135 include $(TOP)/mk/target.mk
137 ifeq "$(OBJECT_FILEFORMAT)" "PEi"
138 HSbase.o : $(GHCI_LIBOBJS)
139 $(LD) -r $(LD_X) -o HSbase1.o $(filter GHC/%, $(GHCI_LIBOBJS))
140 $(LD) -r $(LD_X) -o HSbase2.o $(filter Text/%, $(GHCI_LIBOBJS))
141 $(LD) -r $(LD_X) -o HSbase3.o $(filter-out GHC/% Text/%, $(GHCI_LIBOBJS) $(STUBOBJS))
143 endif # OBJECT_FILEFORMAT = PEi