aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2009-02-25 01:38:13 +0000
committerIan Lynagh <igloo@earth.li>2009-02-25 01:38:13 +0000
commit403e42dc6d75cbb0c7daacb286850598f6fe65ed (patch)
tree5e697ced3e88391c0970ac9887dfc175141ac322
parentf83abdb15139627b4e93fb5651b62bf136f8794e (diff)
Give haddock a wrapper on unix in the new GHC build system
-rw-r--r--ghc.mk22
1 files changed, 14 insertions, 8 deletions
diff --git a/ghc.mk b/ghc.mk
index 5a51ecae..2337975b 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -2,17 +2,23 @@
utils/haddock_USES_CABAL = YES
utils/haddock_PACKAGE = haddock
utils/haddock_CONFIGURE_OPTS = --flag in-ghc-tree
-utils/haddock_dist_PROG = haddock
-# XXX This is a bit of a hack. We mkdepend with stage1 as if .depend
-# depends on the stage2 compiler then make goes wrong: haddock's
-# .depend gets included, which means that make won't reload until
-# it's built, but we can't build it without the stage2 compiler. We
-# therefore build the stage2 compiler before its .depend file is
-# available, and so compilation fails.
-utils/haddock_dist_HC_DEP = $(GHC_STAGE1)
# XXX This is a temporary hack:
utils/haddock_HC_OPTS += -Wwarn
+ifeq "$(Windows)" "YES"
+utils/haddock_dist_PROG = haddock
+else
+utils/haddock_dist_PROG = haddock-real
+
+$(INPLACE_BIN)/haddock: $(INPLACE_BIN)/haddock-real
+ $(RM) -f $@
+ echo '#!$(SHELL)' >> $@
+ echo 'executablename=$(FPTOOLS_TOP_ABS)/$<' >> $@
+ echo 'datadir=$(FPTOOLS_TOP_ABS)/inplace/lib' >> $@
+ cat utils/haddock/haddock.wrapper >> $@
+ $(EXECUTABLE_FILE) $@
+endif
+
$(eval $(call build-prog,utils/haddock,dist,2))
utils/haddock_dist_MODULES += Paths_haddock