summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2008-08-28 12:48:14 +0000
committerIan Lynagh <igloo@earth.li>2008-08-28 12:48:14 +0000
commit4a73af53332e94ca56a6faed96f8391c14ecfa18 (patch)
tree29a312c4d5ec9c04e383a58c8c856905a318fd84
parentc35325dd60a671e6e7fcc513fc3ae02586106c4c (diff)
downloadhaskell-4a73af53332e94ca56a6faed96f8391c14ecfa18.tar.gz
Update the build system to handle building and using haddock2
One side-effect of this is that we need to build the install-utils with stage2 rather than stage1 as we need the ghc package.
-rw-r--r--Makefile5
-rw-r--r--compiler/Makefile4
-rw-r--r--libraries/Makefile6
-rw-r--r--libraries/gen_contents_index7
-rw-r--r--mk/cabal-flags.mk4
-rw-r--r--mk/cabal.mk10
-rw-r--r--utils/Makefile23
-rw-r--r--utils/ghc-pkg/Makefile4
-rw-r--r--utils/installPackage/Makefile2
-rw-r--r--utils/installPackage/installPackage.hs2
10 files changed, 33 insertions, 34 deletions
diff --git a/Makefile b/Makefile
index 02d43d984d..6946c4c716 100644
--- a/Makefile
+++ b/Makefile
@@ -125,7 +125,6 @@ stage1 : $(GCC_LIB_DEP) check-all
$(MAKE) -C rts boot
$(MAKE) -C rts
$(MAKE) -C libraries all
- $(MAKE) -C utils with-stage-1
# When making distributions (i.e., whether with binary-dist or using the
# vanilla install target to create an installer package), we can have problems
@@ -137,8 +136,10 @@ stage1 : $(GCC_LIB_DEP) check-all
stage2 : check-all
$(MAKE) -C compiler stage=2 boot
$(MAKE) -C compiler stage=2
+ $(MAKE) -C utils with-stage-2
ifeq "$(HADDOCK_DOCS)" "YES"
- $(MAKE) -C compiler stage=2 doc
+ $(MAKE) -C libraries doc
+ $(MAKE) -C compiler doc stage=2
endif
stage3 : check-all
diff --git a/compiler/Makefile b/compiler/Makefile
index 67d4e3f774..7056ae7555 100644
--- a/compiler/Makefile
+++ b/compiler/Makefile
@@ -199,7 +199,9 @@ build.stage.%:
$(MAKE) -C ../ghc stage=$*
doc.stage.%:
- $(CABAL) haddock --distpref dist-stage$*
+ $(CABAL) haddock --distpref dist-stage$* \
+ --haddock-option=--optghc=-DSTAGE=$* \
+ --with-haddock=$(FPTOOLS_TOP_ABS)/utils/haddock/install-inplace/bin/haddock
# XXX We ought to actually install the (stage 2) library
install:
diff --git a/libraries/Makefile b/libraries/Makefile
index 914c35106d..d33435e450 100644
--- a/libraries/Makefile
+++ b/libraries/Makefile
@@ -197,10 +197,6 @@ endif
all: build
-ifeq "$(HADDOCK_DOCS)" "YES"
-all: doc
-endif
-
.PHONY: rebuild.library.%
.PHONY: remake.library.%
@@ -297,7 +293,7 @@ doc: $(foreach SUBDIR,$(DOC_SUBDIRS),doc.library.$(SUBDIR))
ifneq "$(HSCOLOUR)" ""
CABAL_HADDOCK_FLAGS += --hyperlink-source
endif
-CABAL_HADDOCK_FLAGS += --with-haddock=$(FPTOOLS_ABS_TOP)/utils/haddock/install-inplace/bin/haddock
+CABAL_HADDOCK_FLAGS += --with-haddock=$(FPTOOLS_TOP_ABS)/utils/haddock/install-inplace/bin/haddock
$(foreach SUBDIR,$(DOC_SUBDIRS),doc.library.$(SUBDIR)):\
doc.library.%: stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).% \
diff --git a/libraries/gen_contents_index b/libraries/gen_contents_index
index 4ddb58a0e2..8129bebd41 100644
--- a/libraries/gen_contents_index
+++ b/libraries/gen_contents_index
@@ -2,6 +2,7 @@
set -e
+HADDOCK=../utils/haddock/install-inplace/bin/haddock
HADDOCK_ARGS=
NAMES=
@@ -22,9 +23,9 @@ do
done
# Now create the combined contents and index pages
-haddock --gen-index --gen-contents -o . \
- -t "Haskell Hierarchical Libraries" \
- $HADDOCK_ARGS
+$HADDOCK --gen-index --gen-contents -o . \
+ -t "Haskell Hierarchical Libraries" \
+ $HADDOCK_ARGS
# Unhandled Windows help stuff?:
diff --git a/mk/cabal-flags.mk b/mk/cabal-flags.mk
index b50702d0e5..4144f255d2 100644
--- a/mk/cabal-flags.mk
+++ b/mk/cabal-flags.mk
@@ -29,10 +29,6 @@ ifneq "$(ALEX)" ""
COMMON_CONFIGURE_FLAGS += --with-alex=$(ALEX)
endif
-ifneq "$(HADDOCK)" ""
-COMMON_CONFIGURE_FLAGS += --with-haddock=$(HADDOCK)
-endif
-
ifneq "$(HAPPY)" ""
COMMON_CONFIGURE_FLAGS += --with-happy=$(HAPPY)
endif
diff --git a/mk/cabal.mk b/mk/cabal.mk
index 079f8033ca..8c486a982e 100644
--- a/mk/cabal.mk
+++ b/mk/cabal.mk
@@ -14,14 +14,14 @@ INSTALL_FLAGS =
endif
endif
-# Tell stage1 to make a dynamically-linked binary, but no wrapper. We assume
+# Tell stage2 to make a dynamically-linked binary, but no wrapper. We assume
# that in an installation the shared libs will be installed somewhere that
# the system can find them.
ifeq "$(BuildSharedLibs)" "YES"
DYN_FLAGS = --ghc-option=-dynamic --ghc-option=-dynload --ghc-option=deploy
endif
-.PHONY: default all with-bootstrapping-compiler with-stage-1 clean distclean
+.PHONY: default all with-bootstrapping-compiler with-stage-2 clean distclean
default all: with-bootstrapping-compiler
@@ -34,12 +34,12 @@ with-bootstrapping-compiler:
$(CABAL) build --distpref dist-inplace $(BUILD_FLAGS)
$(CABAL) install --distpref dist-inplace $(INSTALL_FLAGS)
-with-stage-1:
+with-stage-2:
$(CABAL) configure --distpref dist-install \
$(INSTALL_DIRS_CONFIGURE_FLAGS) \
- $(USE_STAGE1_CONFIGURE_FLAGS) \
+ $(USE_STAGE2_CONFIGURE_FLAGS) \
$(COMMON_CONFIGURE_FLAGS) \
- $(EXTRA_STAGE1_CONFIGURE_FLAGS)
+ $(EXTRA_STAGE2_CONFIGURE_FLAGS)
$(CABAL) build --distpref dist-install $(DYN_FLAGS) $(BUILD_FLAGS)
install:
diff --git a/utils/Makefile b/utils/Makefile
index 06fa2626bf..ab7f6ba9c2 100644
--- a/utils/Makefile
+++ b/utils/Makefile
@@ -52,15 +52,15 @@ endif
WITH_BOOTSTRAPPING_COMPILER = installPackage ghc-pkg hsc2hs hpc
-WITH_STAGE1 = installPackage ghc-pkg hasktags runghc hpc pwd haddock
+WITH_STAGE2 = installPackage ghc-pkg hasktags runghc hpc pwd haddock
ifneq "$(NO_INSTALL_HSC2HS)" "YES"
-WITH_STAGE1 += hsc2hs
+WITH_STAGE2 += hsc2hs
endif
# sort removes duplicates - we don't actually care about the order
-WITH_EITHER = $(sort $(WITH_BOOTSTRAPPING_COMPILER) $(WITH_STAGE1))
+WITH_EITHER = $(sort $(WITH_BOOTSTRAPPING_COMPILER) $(WITH_STAGE2))
-binary-dist: $(foreach P,$(WITH_STAGE1),binary-dist.$P)
+binary-dist: $(foreach P,$(WITH_STAGE2),binary-dist.$P)
ifeq "$(WHERE_AM_I)" ""
echo "I don't know where I am" >&2
exit 1
@@ -75,9 +75,10 @@ distclean:: $(foreach P,$(WITH_EITHER),distclean.$P)
with-bootstrapping-compiler: \
$(foreach P,$(WITH_BOOTSTRAPPING_COMPILER),with-bootstrapping-compiler.$P)
-with-stage-1: $(foreach P,$(WITH_STAGE1),with-stage-1.$P)
+with-stage-2: $(foreach P,$(WITH_STAGE2),with-stage-2.$P)
+ $(MAKE) -C haddock install-inplace
-install:: $(foreach P,$(WITH_STAGE1),install.$P)
+install:: $(foreach P,$(WITH_STAGE2),install.$P)
$(foreach P,$(WITH_EITHER),clean.$P): \
clean.%:
@@ -91,15 +92,15 @@ $(foreach P,$(WITH_BOOTSTRAPPING_COMPILER),with-bootstrapping-compiler.$P): \
with-bootstrapping-compiler.%:
$(MAKE) -C $* with-bootstrapping-compiler
-$(foreach P,$(WITH_STAGE1),with-stage-1.$P): \
-with-stage-1.%:
- $(MAKE) -C $* with-stage-1
+$(foreach P,$(WITH_STAGE2),with-stage-2.$P): \
+with-stage-2.%:
+ $(MAKE) -C $* with-stage-2
-$(foreach P,$(WITH_STAGE1),install.$P): \
+$(foreach P,$(WITH_STAGE2),install.$P): \
install.%:
$(MAKE) -C $* install
-$(foreach P,$(WITH_STAGE1),binary-dist.$P): \
+$(foreach P,$(WITH_STAGE2),binary-dist.$P): \
binary-dist.%:
$(MAKE) -C $* binary-dist WHERE_AM_I=$(WHERE_AM_I)/$*
diff --git a/utils/ghc-pkg/Makefile b/utils/ghc-pkg/Makefile
index 0783d3f1b2..632e02c1d5 100644
--- a/utils/ghc-pkg/Makefile
+++ b/utils/ghc-pkg/Makefile
@@ -3,13 +3,13 @@ TOP=../..
ENABLE_SHELL_WRAPPERS = YES
EXTRA_CLEAN = Version.hs
EXTRA_INPLACE_CONFIGURE_FLAGS = $(INPLACE_GHC_DATADIR_CONFIGURE_FLAGS)
-EXTRA_STAGE1_CONFIGURE_FLAGS = --datasubdir=.
+EXTRA_STAGE2_CONFIGURE_FLAGS = --datasubdir=.
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/cabal.mk
with-bootstrapping-compiler: Version.hs
-with-stage-1: Version.hs
+with-stage-2: Version.hs
Version.hs: Makefile $(TOP)/mk/config.mk
$(RM) -f Version.hs
diff --git a/utils/installPackage/Makefile b/utils/installPackage/Makefile
index b5659f9c21..e963060d50 100644
--- a/utils/installPackage/Makefile
+++ b/utils/installPackage/Makefile
@@ -4,6 +4,6 @@ include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/cabal.mk
# We should stop installPackage being installed itself, but we do need
-# to build it with the stage1 compiler as we need to use it when
+# to build it with the stage2 compiler as we need to use it when
# installing.
diff --git a/utils/installPackage/installPackage.hs b/utils/installPackage/installPackage.hs
index 2c3d245fc8..9ec7282592 100644
--- a/utils/installPackage/installPackage.hs
+++ b/utils/installPackage/installPackage.hs
@@ -59,11 +59,13 @@ doInstall verbosity distPref enableShellWrappers strip
do let userHooks = simpleUserHooks
copyto = if null destdir then NoCopyDest else CopyTo destdir
copyFlags = defaultCopyFlags {
+ copyDistPref = toFlag distPref,
copyUseWrapper = toFlag enableShellWrappers,
copyDest = toFlag copyto,
copyVerbosity = toFlag verbosity
}
registerFlags = defaultRegisterFlags {
+ regDistPref = toFlag distPref,
regPackageDB = toFlag GlobalPackageDB,
regVerbosity = toFlag verbosity,
regGenScript = toFlag $ False,