1 # -----------------------------------------------------------------------------
2 # $Id: Makefile,v 1.46 2003/07/24 13:53:20 simonmar 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 # These two lines are required for pre-processing ghc/compiler/prelude/primops.txt
62 SRC_CPP_OPTS += -I$(GHC_INCLUDE_DIR)
63 SRC_CPP_OPTS += ${GhcCppOpts}
65 ifeq "$(BootingFromHc)" "YES"
66 GHC/PrimopWrappers.hs:
67 touch GHC/PrimopWrappers.hs
69 GHC/PrimopWrappers.hs: $(GHC_COMPILER_DIR)/prelude/primops.txt
71 $(GHC_GENPRIMOP) --make-haskell-wrappers < $< > $@
74 boot :: GHC/PrimopWrappers.hs
76 EXTRA_SRCS += GHC/PrimopWrappers.hs
77 CLEAN_FILES += GHC/PrimopWrappers.hs
79 #-----------------------------------------------------------------------------
80 # Building the library for GHCi
82 # The procedure differs from that in fptools/mk/target.mk in one way:
83 # (*) on Win32 we must split it into two, because a single .o file can't
84 # have more than 65536 relocations in it [due to a bug in the GNU
87 OBJECT_FILEFORMAT=unknown
88 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
91 ifeq "$(TARGETPLATFORM)" "i386-unknown-cygwin32"
95 ifeq "$(OBJECT_FILEFORMAT)" "PEi"
97 # Turn off standard rule which creates HSbase.o from LIBOBJS.
98 DONT_WANT_STD_GHCI_LIB_RULE=YES
100 GHCI_LIBOBJS = $(HS_OBJS)
102 INSTALL_LIBS += HSbase1.o HSbase2.o HSbase3.o
104 endif # OBJECT_FILEFORMAT = PEi
107 # -----------------------------------------------------------------------------
108 # Doc building with Haddock
110 EXCLUDED_HADDOCK_SRCS = \
111 GHC/PrimopWrappers.hs \
114 SRC_HADDOCK_OPTS += -t "Haskell Core Libraries (base package)" \
115 --no-implicit-prelude -p prologue.txt
117 # -----------------------------------------------------------------------------
119 include $(TOP)/mk/target.mk
121 ifeq "$(OBJECT_FILEFORMAT)" "PEi"
122 HSbase.o : $(GHCI_LIBOBJS)
123 $(LD) -r $(LD_X) -o HSbase1.o $(filter GHC/%, $(GHCI_LIBOBJS))
124 $(LD) -r $(LD_X) -o HSbase2.o $(filter Text/%, $(GHCI_LIBOBJS))
125 $(LD) -r $(LD_X) -o HSbase3.o $(filter-out GHC/% Text/%, $(GHCI_LIBOBJS))
127 endif # OBJECT_FILEFORMAT = PEi