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))
# 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
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
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.%