1 # -----------------------------------------------------------------------------
2 # $Id: Makefile,v 1.29 2002/05/31 12:22:33 panne Exp $
5 include $(TOP)/mk/boilerplate.mk
7 # -----------------------------------------------------------------------------
9 SUBDIRS = cbits include
37 Text/ParserCombinators \
38 Text/ParserCombinators/Parsec \
45 SRC_HC_OPTS += -fglasgow-exts -cpp -Iinclude
46 SRC_HSC2HS_OPTS += -Iinclude
48 # Make sure we can get hold of regex.h
49 ifneq "$(HavePosixRegex)" "YES"
50 SRC_HC_OPTS += -Icbits/regex
51 SRC_HSC2HS_OPTS += -Icbits/regex
54 # -----------------------------------------------------------------------------
57 # ESSENTIAL, for getting reasonable performance from the I/O library:
58 SRC_HC_OPTS += -funbox-strict-fields
60 # -----------------------------------------------------------------------------
63 GHC/PrimopWrappers.hs: $(GHC_COMPILER_DIR)/prelude/primops.txt
65 $(GHC_GENPRIMOP) --make-haskell-wrappers < $< > $@
67 boot :: GHC/PrimopWrappers.hs
69 EXTRA_SRCS += GHC/PrimopWrappers.hs
70 CLEAN_FILES += GHC/PrimopWrappers.hs
72 #-----------------------------------------------------------------------------
73 # Building the library for GHCi
75 # The procedure differs from that in fptools/mk/target.mk in one way:
76 # (*) on Win32 we must split it into two, because a single .o file can't
77 # have more than 65536 relocations in it.
79 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
81 # Turn off standard rule which creates HSbase.o from LIBOBJS.
82 DONT_WANT_STD_GHCI_LIB_RULE=YES
84 GHCI_LIBOBJS = $(HS_OBJS)
86 INSTALL_LIBS += HSbase1.o HSbase2.o
88 endif # TARGETPLATFORM = i386-unknown-mingw32
91 # -----------------------------------------------------------------------------
92 # Doc building with Haddock
94 EXCLUDED_HADDOCK_SRCS = \
98 HS_PPS = $(addsuffix .raw-hs, $(basename $(filter-out $(EXCLUDED_HADDOCK_SRCS), $(HS_SRCS))))
100 HADDOCK = $(FPTOOLS_TOP)/haddock/src/haddock-inplace
102 # Urgh, hack needed to ensure that the value of HS_SRCS is computed in time for
103 # the docs rule below.
104 PRE_SRCS := $(ALL_SRCS)
107 haddock-docs : $(HS_PPS)
108 $(HADDOCK) -t "Haskell Core Libraries" -h -s "." $(HS_PPS)
111 $(GHC_INPLACE) $(HC_OPTS) -D__HADDOCK__ -E -cpp $< -o $<.tmp && sed -e 's/^#.*//' <$<.tmp >$@
114 $(GHC_INPLACE) $(HC_OPTS) -D__HADDOCK__ -E -cpp $< -o $<.tmp && sed -e 's/^#.*//' <$<.tmp >$@
116 # -----------------------------------------------------------------------------
118 include $(TOP)/mk/target.mk
120 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
121 HSbase.o : $(GHCI_LIBOBJS)
122 $(LD) -r $(LD_X) -o HSbase1.o $(filter GHC/%, $(GHCI_LIBOBJS))
123 $(LD) -r $(LD_X) -o HSbase2.o $(filter-out GHC/%, $(GHCI_LIBOBJS))
125 endif # TARGETPLATFORM = i386-unknown-mingw32