2 include $(TOP)/mk/boilerplate.mk
4 # -----------------------------------------------------------------------------
6 SUBDIRS = cbits include
16 Data/ByteString/Lazy \
35 Text/ParserCombinators \
43 SRC_HC_OPTS += -fglasgow-exts -cpp -Iinclude -"\#include" HsBase.h
44 SRC_HSC2HS_OPTS += -Iinclude -I$(GHC_INCLUDE_DIR)
46 # -----------------------------------------------------------------------------
49 # ESSENTIAL, for getting reasonable performance from the I/O library:
50 SRC_HC_OPTS += -funbox-strict-fields
52 # -----------------------------------------------------------------------------
55 # These two lines are required for pre-processing compiler/prelude/primops.txt
56 SRC_CPP_OPTS += -I$(GHC_INCLUDE_DIR)
57 SRC_CPP_OPTS += ${GhcCppOpts}
59 ifeq "$(BootingFromHc)" "YES"
60 GHC/PrimopWrappers.hs:
61 touch GHC/PrimopWrappers.hs
63 GHC/PrimopWrappers.hs: $(GHC_COMPILER_DIR)/prelude/primops.txt GHC/Prim.hs
65 $(GENPRIMOP) --make-haskell-wrappers < $< > $@
68 GHC/Prim.hs: $(GHC_COMPILER_DIR)/prelude/primops.txt
70 $(GENPRIMOP) --make-haskell-source < $< > $@
72 EXCLUDED_SRCS = GHC/Prim.hs
73 EXTRA_HADDOCK_SRCS = GHC/Prim.hs
75 boot :: GHC/PrimopWrappers.hs
77 EXTRA_SRCS += GHC/PrimopWrappers.hs
78 CLEAN_FILES += GHC/PrimopWrappers.hs
80 # -----------------------------------------------------------------------------
81 ifneq "$(BootingFromHc)" "YES"
83 Control/Concurrent_stub.$(way_)o
85 CLEAN_FILES += $(STUBOBJS) \
86 Control/Concurrent_stub.[ch]
89 #-----------------------------------------------------------------------------
90 # Building the library for GHCi
92 # The procedure differs from that in fptools/mk/target.mk in one way:
93 # (*) on Win32 we must split it into two, because a single .o file can't
94 # have more than 65536 relocations in it [due to a bug in the GNU
97 OBJECT_FILEFORMAT=unknown
98 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
101 ifeq "$(TARGETPLATFORM)" "i386-unknown-cygwin32"
102 OBJECT_FILEFORMAT=PEi
105 ifeq "$(OBJECT_FILEFORMAT)" "PEi"
107 # Turn off standard rule which creates HSbase.o from LIBOBJS.
108 #DONT_WANT_STD_GHCI_LIB_RULE=YES
110 GHCI_LIBOBJS = $(HS_OBJS)
112 INSTALL_LIBS += HSbase.o
114 endif # OBJECT_FILEFORMAT = PEi
117 # -----------------------------------------------------------------------------
118 # Doc building with Haddock
120 EXCLUDED_HADDOCK_SRCS = \
121 GHC/PrimopWrappers.hs \
124 SRC_HADDOCK_OPTS += -t "Haskell Hierarchical Libraries ($(PACKAGE) package)" \
125 --no-implicit-prelude
127 # -----------------------------------------------------------------------------
129 GHC/ForeignPtr.o Data/Array/IO/Internals.o Data/Array/Base.o \
130 Data/Generics/Instances.o Data/Complex.o Data/Array.o Data/STRef.o \
131 Data/Dynamic.o Data/Typeable.o Data/PackedString.o System/Mem/Weak.o \
132 System/Mem/StableName.o System/Posix/Types.o Control/Monad/ST.o \
133 Control/Exception.o Foreign/C/Types.o Foreign/ForeignPtr.o: include/Typeable.h
135 System/Posix/Types.o Foreign/C/Types.o: include/CTypes.h
137 # -----------------------------------------------------------------------------
139 DIST_CLEAN_FILES += base.buildinfo config.cache config.status
141 include $(TOP)/mk/target.mk