summaryrefslogtreecommitdiff
path: root/rules/haddock.mk
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2009-04-26 11:42:15 +0000
committerIan Lynagh <igloo@earth.li>2009-04-26 11:42:15 +0000
commit34cc75e1a62638f2833815746ebce0a9114dc26b (patch)
treeef21e8fd7af1356beea9cce7d6efb8a65374e24c /rules/haddock.mk
parent74e1368d4688ee16f6decdf2cd3ebe27506b26ba (diff)
downloadhaskell-34cc75e1a62638f2833815746ebce0a9114dc26b.tar.gz
GHC new build system megapatch
Diffstat (limited to 'rules/haddock.mk')
-rw-r--r--rules/haddock.mk27
1 files changed, 27 insertions, 0 deletions
diff --git a/rules/haddock.mk b/rules/haddock.mk
new file mode 100644
index 0000000000..74cb20713f
--- /dev/null
+++ b/rules/haddock.mk
@@ -0,0 +1,27 @@
+
+define haddock # args: $1 = dir, $2 = distdir, $3 = way
+
+ifneq "$$($1_$2_DO_HADDOCK)" "NO"
+
+ifeq "$$($$($1_PACKAGE)_HADDOCK_FILE)" ""
+$$($1_PACKAGE)_HADDOCK_FILE = $1/$2/doc/html/$$($1_PACKAGE)/$$($1_PACKAGE).haddock
+else
+$$(error Already got a haddock file for $$($1_PACKAGE))
+endif
+
+$(call all-target,$1_$2_haddock,$$($$($1_PACKAGE)_HADDOCK_FILE))
+
+$$($1_PACKAGE)_HADDOCK_DEPS = $$(foreach n,$$($1_$2_DEP_NAMES),$$($$n_HADDOCK_FILE))
+
+ifeq "$$(HSCOLOUR_SRCS)" "YES"
+$1_$2_HADDOCK_FLAGS += --hyperlink-source
+endif
+
+$$($$($1_PACKAGE)_HADDOCK_FILE) : $$(MKDIRHIER) $(INPLACE_BIN)/haddock$(exeext) $$(GHC_CABAL_INPLACE) $$($1_$2_HS_SRCS) $$($$($1_PACKAGE)_HADDOCK_DEPS)
+ $$(MKDIRHIER) $$(dir $$@)
+ $$(GHC_CABAL_INPLACE) haddock $2 $1 --with-haddock=$$(TOP)/$(INPLACE_BIN)/haddock --with-ghc=$$(TOP)/$(INPLACE_BIN)/ghc-stage2 $$($1_$2_HADDOCK_FLAGS) $$($1_$2_HADDOCK_OPTS)
+
+endif
+
+endef
+