Don't put package version numbers in links in index.html
[ghc-hetmet.git] / libraries / Makefile
index e9f90d3..190e9ce 100644 (file)
@@ -62,13 +62,7 @@ SUBDIRS += $(wildcard QuickCheck)
 SUBDIRS += $(wildcard HUnit)
 SUBDIRS += $(wildcard mtl)
 SUBDIRS += $(wildcard fgl)
-SUBDIRS += $(wildcard X11)
 SUBDIRS += $(wildcard time)
-ifeq "$(Windows)" "NO"
-# HGL is not working on Win32, so omit it for now.  Better not to ship it
-# at all than to ship a broken version.
-SUBDIRS += $(wildcard HGL)
-endif
 SUBDIRS += $(wildcard OpenGL)
 SUBDIRS += $(wildcard GLUT)
 SUBDIRS += $(wildcard OpenAL)
@@ -76,7 +70,6 @@ SUBDIRS += $(wildcard ALUT)
 SUBDIRS += $(wildcard stm)
 SUBDIRS += $(wildcard xhtml)
 SUBDIRS += $(wildcard cgi)
-SUBDIRS += $(wildcard arrows)
 ifeq "$(GhcLibsWithObjectIO)" "YES"
 SUBDIRS += $(wildcard ObjectIO)
 endif
@@ -140,6 +133,10 @@ CONFIGURE_OPTS += --enable-split-objs
 CONFIGURE_STAMP_EXTRAS := $(CONFIGURE_STAMP_EXTRAS)-splitting
 endif
 
+ifneq "$(HSCOLOUR)" ""
+CONFIGURE_OPTS += --with-hscolour=$(HSCOLOUR)
+endif
+
 BOOTSTRAP_LIBS = Cabal filepath
 BOOTSTRAP_STAMPS = $(addprefix stamp/bootstrapping.,$(BOOTSTRAP_LIBS))
 BOOTSTRAP_INC_1_UP = -DCABAL_VERSION=1,3 $(addprefix -i../bootstrapping.,$(BOOTSTRAP_LIBS))
@@ -257,12 +254,19 @@ stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).%: %/setup/Setup
 # build dies!
 
 # Build the library using 'make'
+# We re-run 'setup makefile' each time, just in case any preprocessing
+# needs to be done.  However, we're careful not to overwrite GNUmakefile
+# if it hasn't changed, so that dependency-generation isn't forced
+# every time.
 $(foreach SUBDIR,$(SUBDIRS),make.library.$(SUBDIR)):\
 make.library.%: stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).% \
-               %/GNUmakefile \
                 %/setup/Setup ifBuildable/ifBuildable
        if ifBuildable/ifBuildable $*; then \
          cd $* && \
+         cmp -s ../Makefile.local Makefile.local || cp ../Makefile.local .; \
+         mv GNUmakefile GNUmakefile.tmp; \
+         setup/Setup makefile -f GNUmakefile; \
+         cmp -s GNUmakefile GNUmakefile.tmp && mv GNUmakefile.tmp GNUmakefile; \
          $(MAKE) $(MFLAGS) && \
          setup/Setup register --inplace; \
        fi
@@ -276,25 +280,24 @@ build.library.%: stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).% \
          setup/Setup build $(addprefix --ghc-option=,$(GhcLibHcOpts)); \
        fi
 
-$(foreach SUBDIR,$(SUBDIRS),$(SUBDIR)/GNUmakefile):\
-%/GNUmakefile: stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).% \
-                 %/setup/Setup ifBuildable/ifBuildable
-       $(RM) $*/GNUmakefile
-       cp Makefile.local $*
-       if ifBuildable/ifBuildable $*; then \
-          cd $* && setup/Setup makefile -f GNUmakefile; \
-       fi
+.PHONY: doc html
 
-.PHONY: doc
+html: doc
 
 doc: $(foreach SUBDIR,$(SUBDIRS),doc.library.$(SUBDIR))
        sh gen_contents_index --inplace
 
+# Making hyperlinked source only works if we have hscolour
+ifneq "$(HSCOLOUR)" ""
+CABAL_HADDOCK_FLAGS=--hyperlink-source
+endif
+
 $(foreach SUBDIR,$(SUBDIRS),doc.library.$(SUBDIR)):\
 doc.library.%: stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).% \
                %/setup/Setup ifBuildable/ifBuildable
        if ifBuildable/ifBuildable $*; then \
-         cd $* && setup/Setup haddock --html-location='../$$pkgid'; \
+         cd $* && setup/Setup haddock --html-location='../$$pkgid' \
+                                      $(CABAL_HADDOCK_FLAGS); \
        fi
 
 .PHONY: distclean clean clean.library.%
@@ -393,3 +396,10 @@ binary-dist.library.%:
             \( \( -name "*.o" -o -name "*.p_o" \) -a ! -name "HS*" \) \
             -exec rm {} \; ; \
        fi
+
+# Ignore some doc targets that we don't support
+# The root recurses into us when these targets are made
+.PHONY: html-no-chunks chm HxS fo dvi ps pdf
+html-no-chunks chm HxS fo dvi ps pdf:
+       @:
+