1 # -----------------------------------------------------------------------------
2 # $Id: Makefile,v 1.38 2002/09/06 14:34:15 simonmar Exp $
5 include $(TOP)/mk/boilerplate.mk
7 # -----------------------------------------------------------------------------
9 SUBDIRS = cbits include
33 Text/ParserCombinators \
34 Text/ParserCombinators/Parsec \
41 SRC_HC_OPTS += -fglasgow-exts -cpp -Iinclude
42 SRC_HSC2HS_OPTS += -Iinclude -I$(FPTOOLS_TOP)/ghc/includes
44 # Make sure we can get hold of regex.h
45 ifneq "$(HavePosixRegex)" "YES"
46 SRC_HC_OPTS += -Icbits/regex
47 SRC_HSC2HS_OPTS += -Icbits/regex
50 # -----------------------------------------------------------------------------
53 # ESSENTIAL, for getting reasonable performance from the I/O library:
54 SRC_HC_OPTS += -funbox-strict-fields
56 # -----------------------------------------------------------------------------
59 GHC/PrimopWrappers.hs: $(GHC_COMPILER_DIR)/prelude/primops.txt
61 $(GHC_GENPRIMOP) --make-haskell-wrappers < $< > $@
63 boot :: GHC/PrimopWrappers.hs
65 EXTRA_SRCS += GHC/PrimopWrappers.hs
66 CLEAN_FILES += GHC/PrimopWrappers.hs
68 #-----------------------------------------------------------------------------
69 # Building the library for GHCi
71 # The procedure differs from that in fptools/mk/target.mk in one way:
72 # (*) on Win32 we must split it into two, because a single .o file can't
73 # have more than 65536 relocations in it [due to a bug in the GNU
76 OBJECT_FILEFORMAT=unknown
77 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
80 ifeq "$(TARGETPLATFORM)" "i386-unknown-cygwin32"
84 ifeq "$(OBJECT_FILEFORMAT)" "PEi"
86 # Turn off standard rule which creates HSbase.o from LIBOBJS.
87 DONT_WANT_STD_GHCI_LIB_RULE=YES
89 GHCI_LIBOBJS = $(HS_OBJS)
91 INSTALL_LIBS += HSbase1.o HSbase2.o HSbase3.o
93 endif # OBJECT_FILEFORMAT = PEi
96 # -----------------------------------------------------------------------------
97 # Doc building with Haddock
99 EXCLUDED_HADDOCK_SRCS = \
103 SRC_HADDOCK_OPTS += -t "Haskell Core Libraries (base package)" \
104 --no-implicit-prelude -p prologue.txt
106 # -----------------------------------------------------------------------------
108 include $(TOP)/mk/target.mk
110 ifeq "$(OBJECT_FILEFORMAT)" "PEi"
111 HSbase.o : $(GHCI_LIBOBJS)
112 $(LD) -r $(LD_X) -o HSbase1.o $(filter GHC/%, $(GHCI_LIBOBJS))
113 $(LD) -r $(LD_X) -o HSbase2.o $(filter Text/%, $(GHCI_LIBOBJS))
114 $(LD) -r $(LD_X) -o HSbase3.o $(filter-out GHC/% Text/%, $(GHCI_LIBOBJS))
116 endif # OBJECT_FILEFORMAT = PEi