2 include $(TOP)/mk/boilerplate.mk
4 # -----------------------------------------------------------------------------
6 SUBDIRS = cbits include
33 Text/ParserCombinators \
40 SRC_HC_OPTS += -fglasgow-exts -cpp -Iinclude -"\#include" HsBase.h
41 SRC_HSC2HS_OPTS += -Iinclude -I$(FPTOOLS_TOP)/ghc/includes
43 # If there is no system-supplied POSIX regex library, use our own
44 ifneq "$(HavePosixRegex)" "YES"
45 # Make sure we can get hold of regex.h
46 SRC_HC_OPTS += -Icbits/regex
47 SRC_HSC2HS_OPTS += -Icbits/regex
50 # -----------------------------------------------------------------------------
53 # ESSENTIAL, for getting reasonable performance from the I/O library:
54 SRC_HC_OPTS += -funbox-strict-fields
56 # -----------------------------------------------------------------------------
59 # These two lines are required for pre-processing ghc/compiler/prelude/primops.txt
60 SRC_CPP_OPTS += -I$(GHC_INCLUDE_DIR)
61 SRC_CPP_OPTS += ${GhcCppOpts}
63 ifeq "$(BootingFromHc)" "YES"
64 GHC/PrimopWrappers.hs:
65 touch GHC/PrimopWrappers.hs
67 GHC/PrimopWrappers.hs: $(GHC_COMPILER_DIR)/prelude/primops.txt
69 $(GHC_GENPRIMOP) --make-haskell-wrappers < $< > $@
72 boot :: GHC/PrimopWrappers.hs
74 EXTRA_SRCS += GHC/PrimopWrappers.hs
75 CLEAN_FILES += GHC/PrimopWrappers.hs
77 # -----------------------------------------------------------------------------
78 ifneq "$(BootingFromHc)" "YES"
80 Control/Concurrent_stub.$(way_)o
82 CLEAN_FILES += $(STUBOBJS) \
83 Control/Concurrent_stub.[ch]
86 #-----------------------------------------------------------------------------
87 # Building the library for GHCi
89 # The procedure differs from that in fptools/mk/target.mk in one way:
90 # (*) on Win32 we must split it into two, because a single .o file can't
91 # have more than 65536 relocations in it [due to a bug in the GNU
94 OBJECT_FILEFORMAT=unknown
95 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
98 ifeq "$(TARGETPLATFORM)" "i386-unknown-cygwin32"
102 ifeq "$(OBJECT_FILEFORMAT)" "PEi"
104 # Turn off standard rule which creates HSbase.o from LIBOBJS.
105 DONT_WANT_STD_GHCI_LIB_RULE=YES
107 GHCI_LIBOBJS = $(HS_OBJS)
109 INSTALL_LIBS += HSbase1.o HSbase2.o HSbase3.o
111 endif # OBJECT_FILEFORMAT = PEi
114 # -----------------------------------------------------------------------------
115 # Doc building with Haddock
117 EXCLUDED_HADDOCK_SRCS = \
118 GHC/PrimopWrappers.hs \
121 SRC_HADDOCK_OPTS += -t "Haskell Hierarchical Libraries ($(PACKAGE) package)" \
122 --no-implicit-prelude
124 # -----------------------------------------------------------------------------
126 GHC/ForeignPtr.o Data/Array/IO/Internals.o Data/Array/Base.o \
127 Data/Generics/Instances.o Data/Complex.o Data/Array.o Data/STRef.o \
128 Data/Dynamic.o Data/Typeable.o Data/PackedString.o System/Mem/Weak.o \
129 System/Mem/StableName.o System/Posix/Types.o Control/Monad/ST.o \
130 Control/Exception.o Foreign/C/Types.o Foreign/ForeignPtr.o: include/Typeable.h
132 System/Posix/Types.o Foreign/C/Types.o: include/CTypes.h
134 # -----------------------------------------------------------------------------
136 include $(TOP)/mk/target.mk
138 ifeq "$(OBJECT_FILEFORMAT)" "PEi"
139 HSbase.o : $(GHCI_LIBOBJS)
140 $(LD) -r $(LD_X) -o HSbase1.o $(filter GHC/%, $(GHCI_LIBOBJS))
141 $(LD) -r $(LD_X) -o HSbase2.o $(filter Text/%, $(GHCI_LIBOBJS))
142 $(LD) -r $(LD_X) -o HSbase3.o $(filter-out GHC/% Text/%, $(GHCI_LIBOBJS) $(STUBOBJS))
144 endif # OBJECT_FILEFORMAT = PEi