1 # -----------------------------------------------------------------------------
2 # $Id: Makefile,v 1.42 2003/05/23 10:12:28 ross Exp $
5 include $(TOP)/mk/boilerplate.mk
7 # -----------------------------------------------------------------------------
9 SUBDIRS = cbits include
34 Text/ParserCombinators \
35 Text/ParserCombinators/Parsec \
42 SRC_HC_OPTS += -fglasgow-exts -cpp -Iinclude -\#include HsBase.h
43 SRC_HSC2HS_OPTS += -Iinclude -I$(FPTOOLS_TOP)/ghc/includes
45 # Make sure we can get hold of regex.h
46 ifneq "$(HavePosixRegex)" "YES"
47 SRC_HC_OPTS += -Icbits/regex
48 SRC_HSC2HS_OPTS += -Icbits/regex
51 # -----------------------------------------------------------------------------
54 # ESSENTIAL, for getting reasonable performance from the I/O library:
55 SRC_HC_OPTS += -funbox-strict-fields
57 # -----------------------------------------------------------------------------
60 GHC/PrimopWrappers.hs: $(GHC_COMPILER_DIR)/prelude/primops.txt
62 $(GHC_GENPRIMOP) --make-haskell-wrappers < $< > $@
64 boot :: GHC/PrimopWrappers.hs
66 EXTRA_SRCS += GHC/PrimopWrappers.hs
67 CLEAN_FILES += GHC/PrimopWrappers.hs
69 #-----------------------------------------------------------------------------
70 # Building the library for GHCi
72 # The procedure differs from that in fptools/mk/target.mk in one way:
73 # (*) on Win32 we must split it into two, because a single .o file can't
74 # have more than 65536 relocations in it [due to a bug in the GNU
77 OBJECT_FILEFORMAT=unknown
78 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
81 ifeq "$(TARGETPLATFORM)" "i386-unknown-cygwin32"
85 ifeq "$(OBJECT_FILEFORMAT)" "PEi"
87 # Turn off standard rule which creates HSbase.o from LIBOBJS.
88 DONT_WANT_STD_GHCI_LIB_RULE=YES
90 GHCI_LIBOBJS = $(HS_OBJS)
92 INSTALL_LIBS += HSbase1.o HSbase2.o HSbase3.o
94 endif # OBJECT_FILEFORMAT = PEi
97 # -----------------------------------------------------------------------------
98 # Doc building with Haddock
100 EXCLUDED_HADDOCK_SRCS = \
102 GHC/PrimopWrappers.hs \
105 SRC_HADDOCK_OPTS += -t "Haskell Core Libraries (base package)" \
106 --no-implicit-prelude -p prologue.txt
108 # -----------------------------------------------------------------------------
110 include $(TOP)/mk/target.mk
112 ifeq "$(OBJECT_FILEFORMAT)" "PEi"
113 HSbase.o : $(GHCI_LIBOBJS)
114 $(LD) -r $(LD_X) -o HSbase1.o $(filter GHC/%, $(GHCI_LIBOBJS))
115 $(LD) -r $(LD_X) -o HSbase2.o $(filter Text/%, $(GHCI_LIBOBJS))
116 $(LD) -r $(LD_X) -o HSbase3.o $(filter-out GHC/% Text/%, $(GHCI_LIBOBJS))
118 endif # OBJECT_FILEFORMAT = PEi