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