1 # -----------------------------------------------------------------------------
2 # $Id: Makefile,v 1.25 2002/04/26 13:26:39 simonmar Exp $
5 include $(TOP)/mk/boilerplate.mk
7 # -----------------------------------------------------------------------------
9 SUBDIRS = cbits include
37 Text/ParserCombinators \
44 SRC_HC_OPTS += -fglasgow-exts -cpp -Iinclude
45 SRC_HSC2HS_OPTS += -Iinclude
47 # Make sure we can get hold of regex.h
48 ifneq "$(HavePosixRegex)" "YES"
49 SRC_HC_OPTS += -Icbits/regex
50 SRC_HSC2HS_OPTS += -Icbits/regex
53 # -----------------------------------------------------------------------------
56 # ESSENTIAL, for getting reasonable performance from the I/O library:
57 SRC_HC_OPTS += -funbox-strict-fields
59 # -----------------------------------------------------------------------------
62 GHC/PrimopWrappers.hs: $(GHC_COMPILER_DIR)/prelude/primops.txt
64 $(GHC_GENPRIMOP) --make-haskell-wrappers < $< > $@
66 boot :: GHC/PrimopWrappers.hs
68 CLEAN_FILES += GHC/PrimopWrappers.hs
70 #-----------------------------------------------------------------------------
71 # Building the library for GHCi
73 # The procedure differs from that in fptools/mk/target.mk in one way:
74 # (*) on Win32 we must split it into two, because a single .o file can't
75 # have more than 65536 relocations in it.
77 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
79 # Turn off standard rule which creates HSbase.o from LIBOBJS.
80 DONT_WANT_STD_GHCI_LIB_RULE=YES
82 GHCI_LIBOBJS = $(HS_OBJS)
84 INSTALL_LIBS += HSbase1.o HSbase2.o
86 endif # TARGETPLATFORM = i386-unknown-mingw32
89 # -----------------------------------------------------------------------------
90 # Doc building with Haddock
92 EXCLUDED_HADDOCK_SRCS = \
97 HS_PPS = $(addsuffix .raw-hs, $(basename $(filter-out $(EXCLUDED_HADDOCK_SRCS), $(HS_SRCS))))
99 HADDOCK = $(FPTOOLS_TOP)/haddock/src/haddock-inplace
101 # Urgh, hack needed to ensure that the value of HS_SRCS is computed in time for
102 # the docs rule below.
103 PRE_SRCS := $(ALL_SRCS)
106 haddock-docs : $(HS_PPS)
107 $(HADDOCK) -t "Haskell Core Libraries" -h -s "." $(HS_PPS)
110 $(GHC_INPLACE) $(HC_OPTS) -D__HADDOCK__ -E -cpp $< -o $<.tmp && sed -e 's/^#.*//' <$<.tmp >$@
113 $(GHC_INPLACE) $(HC_OPTS) -E -cpp $< -o $<.tmp && sed -e 's/^#.*//' <$<.tmp >$@
115 # -----------------------------------------------------------------------------
117 include $(TOP)/mk/target.mk
119 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
120 HSbase.o : $(GHCI_LIBOBJS)
121 $(LD) -r $(LD_X) -o HSbase1.o $(filter GHC/%, $(GHCI_LIBOBJS))
122 $(LD) -r $(LD_X) -o HSbase2.o $(filter-out GHC/%, $(GHCI_LIBOBJS))
124 endif # TARGETPLATFORM = i386-unknown-mingw32