3 ifeq "$(strip $(XSLTPROC))" ""
10 # The commands which should be mentioned in the man page
11 MAN_GHC_COMMANDS = ghc ghci
13 # The man page we are generating
19 MAN_PATH = docs/man/$(MAN_PAGE).$(MAN_SECTION)
21 ifneq "$(BINDIST)" "YES"
22 $(MAN_PATH): docs/man/flags.xsl docs/man/flags.xml
23 $(XSLTPROC) $(XSLTPROC_OPTS) $^ > $@
26 # Insert the commands and the library directory into the man page
27 docs/man/flags.xsl: docs/man/gen_flags.xsl.sh
28 $(SHELL) $< "$(MAN_GHC_COMMANDS)" "$(libdir)" > $@
30 # Re-use the flags documentation from the user's guide by injecting some
31 # entities after the XML declaration to make it a stand-alone document.
32 docs/man/flags.xml: docs/users_guide/flags.xml
35 echo "<!DOCTYPE sect1 [<!ENTITY ndash \"-\"> \
36 <!ENTITY ldquo \"\`\"> \
37 <!ENTITY rdquo \"'\">]>" >> $@
38 # "sed 1d" == "tail -n +2", but Solaris apparently rejects the latter
41 ifeq "$(BUILD_MAN)" "YES"
42 ifeq "$(phase)" "final"
43 $(eval $(call all-target,docs/man,$(MAN_PATH)))
46 INSTALL_MANPAGES += $(MAN_PATH)
51 install_man: $(MAN_PATH)
52 $(call INSTALL_DIR,"$(DESTDIR)$(mandir)")
53 $(call INSTALL_DIR,"$(DESTDIR)$(mandir)/man$(MAN_SECTION)")
54 $(call INSTALL_MAN,$(INSTALL_OPTS),$(MAN_PATH),"$(DESTDIR)$(mandir)/man$(MAN_SECTION)")
57 $(eval $(call clean-target,docs/man,,$(MAN_PATH) docs/man/flags.xsl docs/man/flags.xml))