2 include $(TOP)/mk/boilerplate.mk
4 # -----------------------------------------------------------------------------
6 SUBDIRS = cbits include
16 Data/ByteString/Lazy \
35 Text/ParserCombinators \
42 SRC_HC_OPTS += -fglasgow-exts -cpp -Iinclude -"\#include" HsBase.h
43 SRC_HSC2HS_OPTS += -Iinclude -I$(GHC_INCLUDE_DIR)
45 # -----------------------------------------------------------------------------
48 # ESSENTIAL, for getting reasonable performance from the I/O library:
49 SRC_HC_OPTS += -funbox-strict-fields
51 # -----------------------------------------------------------------------------
54 # These two lines are required for pre-processing compiler/prelude/primops.txt
55 SRC_CPP_OPTS += -I$(GHC_INCLUDE_DIR)
56 SRC_CPP_OPTS += ${GhcCppOpts}
58 ifeq "$(BootingFromHc)" "YES"
59 GHC/PrimopWrappers.hs:
60 touch GHC/PrimopWrappers.hs
62 GHC/PrimopWrappers.hs: $(GHC_COMPILER_DIR)/prelude/primops.txt GHC/Prim.hs
64 $(GENPRIMOP) --make-haskell-wrappers < $< > $@
67 GHC/Prim.hs: $(GHC_COMPILER_DIR)/prelude/primops.txt
69 $(GENPRIMOP) --make-haskell-source < $< > $@
71 EXCLUDED_SRCS = GHC/Prim.hs
72 EXTRA_HADDOCK_SRCS = GHC/Prim.hs
74 boot :: GHC/PrimopWrappers.hs
76 EXTRA_SRCS += GHC/PrimopWrappers.hs
77 CLEAN_FILES += GHC/PrimopWrappers.hs
79 # -----------------------------------------------------------------------------
80 ifneq "$(BootingFromHc)" "YES"
82 Control/Concurrent_stub.$(way_)o
84 CLEAN_FILES += $(STUBOBJS) \
85 Control/Concurrent_stub.[ch]
88 #-----------------------------------------------------------------------------
89 # Building the library for GHCi
91 # The procedure differs from that in fptools/mk/target.mk in one way:
92 # (*) on Win32 we must split it into two, because a single .o file can't
93 # have more than 65536 relocations in it [due to a bug in the GNU
96 OBJECT_FILEFORMAT=unknown
97 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
100 ifeq "$(TARGETPLATFORM)" "i386-unknown-cygwin32"
101 OBJECT_FILEFORMAT=PEi
104 ifeq "$(OBJECT_FILEFORMAT)" "PEi"
106 # Turn off standard rule which creates HSbase.o from LIBOBJS.
107 #DONT_WANT_STD_GHCI_LIB_RULE=YES
109 GHCI_LIBOBJS = $(HS_OBJS)
111 INSTALL_LIBS += HSbase.o
113 endif # OBJECT_FILEFORMAT = PEi
116 # -----------------------------------------------------------------------------
117 # Doc building with Haddock
119 EXCLUDED_HADDOCK_SRCS = \
120 GHC/PrimopWrappers.hs \
123 SRC_HADDOCK_OPTS += -t "Haskell Hierarchical Libraries ($(PACKAGE) package)" \
124 --no-implicit-prelude
126 # -----------------------------------------------------------------------------
128 GHC/ForeignPtr.o Data/Array/IO/Internals.o Data/Array/Base.o \
129 Data/Generics/Instances.o Data/Complex.o Data/Array.o Data/STRef.o \
130 Data/Dynamic.o Data/Typeable.o Data/PackedString.o System/Mem/Weak.o \
131 System/Mem/StableName.o System/Posix/Types.o Control/Monad/ST.o \
132 Control/Exception.o Foreign/C/Types.o Foreign/ForeignPtr.o: include/Typeable.h
134 System/Posix/Types.o Foreign/C/Types.o: include/CTypes.h
136 # -----------------------------------------------------------------------------
138 DIST_CLEAN_FILES += base.buildinfo config.cache config.status
140 include $(TOP)/mk/target.mk