[project @ 2002-05-31 12:22:33 by panne]
[ghc-base.git] / Makefile
index 72b6e72..5157ef1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 # -----------------------------------------------------------------------------
-# $Id: Makefile,v 1.22 2002/03/25 15:49:26 sof Exp $
+# $Id: Makefile,v 1.29 2002/05/31 12:22:33 panne Exp $
 
 TOP=..
 include $(TOP)/mk/boilerplate.mk
@@ -34,8 +34,11 @@ ALL_DIRS = \
        Text \
        Text/Html \
        Text/PrettyPrint \
+       Text/ParserCombinators \
+       Text/ParserCombinators/Parsec \
        Text/Regex \
-       Text/Show
+       Text/Show \
+       Text/Read
 
 PACKAGE = base
 
@@ -63,6 +66,7 @@ GHC/PrimopWrappers.hs: $(GHC_COMPILER_DIR)/prelude/primops.txt
 
 boot :: GHC/PrimopWrappers.hs
 
+EXTRA_SRCS  += GHC/PrimopWrappers.hs
 CLEAN_FILES += GHC/PrimopWrappers.hs
 
 #-----------------------------------------------------------------------------
@@ -85,6 +89,31 @@ endif # TARGETPLATFORM = i386-unknown-mingw32
 
 
 # -----------------------------------------------------------------------------
+# Doc building with Haddock
+
+EXCLUDED_HADDOCK_SRCS = \
+       Data/Generics.hs \
+       GHC/PArr.hs
+
+HS_PPS = $(addsuffix .raw-hs, $(basename $(filter-out $(EXCLUDED_HADDOCK_SRCS), $(HS_SRCS))))
+
+HADDOCK = $(FPTOOLS_TOP)/haddock/src/haddock-inplace
+
+# Urgh, hack needed to ensure that the value of HS_SRCS is computed in time for
+# the docs rule below.
+PRE_SRCS := $(ALL_SRCS)
+
+.PHONY: docs
+haddock-docs : $(HS_PPS)
+       $(HADDOCK) -t "Haskell Core Libraries" -h -s "." $(HS_PPS)
+
+%.raw-hs : %.lhs
+       $(GHC_INPLACE) $(HC_OPTS) -D__HADDOCK__ -E -cpp $< -o $<.tmp && sed -e 's/^#.*//' <$<.tmp >$@
+
+%.raw-hs : %.hs
+       $(GHC_INPLACE) $(HC_OPTS) -D__HADDOCK__ -E -cpp $< -o $<.tmp && sed -e 's/^#.*//' <$<.tmp >$@
+
+# -----------------------------------------------------------------------------
 
 include $(TOP)/mk/target.mk
 
@@ -95,4 +124,3 @@ HSbase.o : $(GHCI_LIBOBJS)
        @touch HSbase.o
 endif # TARGETPLATFORM = i386-unknown-mingw32
 
-