1 # -----------------------------------------------------------------------------
2 # $Id: Makefile,v 1.37 2002/07/29 09:57:17 simonmar Exp $
5 include $(TOP)/mk/boilerplate.mk
7 # -----------------------------------------------------------------------------
9 SUBDIRS = cbits include
32 Text/ParserCombinators \
33 Text/ParserCombinators/Parsec \
40 SRC_HC_OPTS += -fglasgow-exts -cpp -Iinclude
41 SRC_HSC2HS_OPTS += -Iinclude
43 # Make sure we can get hold of regex.h
44 ifneq "$(HavePosixRegex)" "YES"
45 SRC_HC_OPTS += -Icbits/regex
46 SRC_HSC2HS_OPTS += -Icbits/regex
49 # -----------------------------------------------------------------------------
52 # ESSENTIAL, for getting reasonable performance from the I/O library:
53 SRC_HC_OPTS += -funbox-strict-fields
55 # -----------------------------------------------------------------------------
58 GHC/PrimopWrappers.hs: $(GHC_COMPILER_DIR)/prelude/primops.txt
60 $(GHC_GENPRIMOP) --make-haskell-wrappers < $< > $@
62 boot :: GHC/PrimopWrappers.hs
64 EXTRA_SRCS += GHC/PrimopWrappers.hs
65 CLEAN_FILES += GHC/PrimopWrappers.hs
67 #-----------------------------------------------------------------------------
68 # Building the library for GHCi
70 # The procedure differs from that in fptools/mk/target.mk in one way:
71 # (*) on Win32 we must split it into two, because a single .o file can't
72 # have more than 65536 relocations in it [due to a bug in the GNU
75 OBJECT_FILEFORMAT=unknown
76 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
79 ifeq "$(TARGETPLATFORM)" "i386-unknown-cygwin32"
83 ifeq "$(OBJECT_FILEFORMAT)" "PEi"
85 # Turn off standard rule which creates HSbase.o from LIBOBJS.
86 DONT_WANT_STD_GHCI_LIB_RULE=YES
88 GHCI_LIBOBJS = $(HS_OBJS)
90 INSTALL_LIBS += HSbase1.o HSbase2.o HSbase3.o
92 endif # OBJECT_FILEFORMAT = PEi
95 # -----------------------------------------------------------------------------
96 # Doc building with Haddock
98 EXCLUDED_HADDOCK_SRCS = \
102 SRC_HADDOCK_OPTS += -t "Haskell Core Libraries (base package)" \
103 --no-implicit-prelude -p prologue.txt
105 # -----------------------------------------------------------------------------
107 include $(TOP)/mk/target.mk
109 ifeq "$(OBJECT_FILEFORMAT)" "PEi"
110 HSbase.o : $(GHCI_LIBOBJS)
111 $(LD) -r $(LD_X) -o HSbase1.o $(filter GHC/%, $(GHCI_LIBOBJS))
112 $(LD) -r $(LD_X) -o HSbase2.o $(filter Text/%, $(GHCI_LIBOBJS))
113 $(LD) -r $(LD_X) -o HSbase3.o $(filter-out GHC/% Text/%, $(GHCI_LIBOBJS))
115 endif # OBJECT_FILEFORMAT = PEi