1 # -----------------------------------------------------------------------------
2 # $Id: Makefile,v 1.45 2003/07/24 12:19:57 ralf Exp $
5 include $(TOP)/mk/boilerplate.mk
7 # -----------------------------------------------------------------------------
9 SUBDIRS = cbits include
35 Text/ParserCombinators \
36 Text/ParserCombinators/Parsec \
43 SRC_HC_OPTS += -fglasgow-exts -cpp -Iinclude -\#include HsBase.h
44 SRC_HSC2HS_OPTS += -Iinclude -I$(FPTOOLS_TOP)/ghc/includes
46 # Make sure we can get hold of regex.h
47 ifneq "$(HavePosixRegex)" "YES"
48 SRC_HC_OPTS += -Icbits/regex
49 SRC_HSC2HS_OPTS += -Icbits/regex
52 # -----------------------------------------------------------------------------
55 # ESSENTIAL, for getting reasonable performance from the I/O library:
56 SRC_HC_OPTS += -funbox-strict-fields
58 # -----------------------------------------------------------------------------
61 ifeq "$(BootingFromHc)" "YES"
62 GHC/PrimopWrappers.hs:
63 touch GHC/PrimopWrappers.hs
65 GHC/PrimopWrappers.hs: $(GHC_COMPILER_DIR)/prelude/primops.txt
67 $(GHC_GENPRIMOP) --make-haskell-wrappers < $< > $@
70 boot :: GHC/PrimopWrappers.hs
72 EXTRA_SRCS += GHC/PrimopWrappers.hs
73 CLEAN_FILES += GHC/PrimopWrappers.hs
75 #-----------------------------------------------------------------------------
76 # Building the library for GHCi
78 # The procedure differs from that in fptools/mk/target.mk in one way:
79 # (*) on Win32 we must split it into two, because a single .o file can't
80 # have more than 65536 relocations in it [due to a bug in the GNU
83 OBJECT_FILEFORMAT=unknown
84 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
87 ifeq "$(TARGETPLATFORM)" "i386-unknown-cygwin32"
91 ifeq "$(OBJECT_FILEFORMAT)" "PEi"
93 # Turn off standard rule which creates HSbase.o from LIBOBJS.
94 DONT_WANT_STD_GHCI_LIB_RULE=YES
96 GHCI_LIBOBJS = $(HS_OBJS)
98 INSTALL_LIBS += HSbase1.o HSbase2.o HSbase3.o
100 endif # OBJECT_FILEFORMAT = PEi
103 # -----------------------------------------------------------------------------
104 # Doc building with Haddock
106 EXCLUDED_HADDOCK_SRCS = \
107 GHC/PrimopWrappers.hs \
110 SRC_HADDOCK_OPTS += -t "Haskell Core Libraries (base package)" \
111 --no-implicit-prelude -p prologue.txt
113 # -----------------------------------------------------------------------------
115 include $(TOP)/mk/target.mk
117 ifeq "$(OBJECT_FILEFORMAT)" "PEi"
118 HSbase.o : $(GHCI_LIBOBJS)
119 $(LD) -r $(LD_X) -o HSbase1.o $(filter GHC/%, $(GHCI_LIBOBJS))
120 $(LD) -r $(LD_X) -o HSbase2.o $(filter Text/%, $(GHCI_LIBOBJS))
121 $(LD) -r $(LD_X) -o HSbase3.o $(filter-out GHC/% Text/%, $(GHCI_LIBOBJS))
123 endif # OBJECT_FILEFORMAT = PEi