2 include $(TOP)/mk/boilerplate.mk
4 ifneq "$(strip $(XSLTPROC))" ""
6 # The commands which should be mentioned in the man page
7 GHC_COMMANDS = ghc ghci
9 # The man page we are generating
15 CLEAN_FILES += $(MAN_PAGE).$(MAN_SECTION) flags.xsl flags.xml
17 ifneq "$(DOING_BIN_DIST)" "YES"
19 all:: $(MAN_PAGE).$(MAN_SECTION)
21 $(MAN_PAGE).$(MAN_SECTION): flags.xsl flags.xml
22 $(XSLTPROC) $(XSLTPROC_OPTS) flags.xsl flags.xml > $@
24 # Insert the commands and the library directory into the man page
25 flags.xsl: gen_flags.xsl.pl
26 $(PERL) gen_flags.xsl.pl "$(GHC_COMMANDS)" "$(libdir)" > $@
28 # Re-use the flags documentation from the user's guide by injecting some
29 # entities after the XML declaration to make it a stand-alone document.
30 flags.xml: ../users_guide/flags.xml
33 echo "<!DOCTYPE sect1 [<!ENTITY ndash \"-\"> \
34 <!ENTITY ldquo \"\`\"> \
35 <!ENTITY rdquo \"'\">]>" >> $@
36 # "sed 1d" == "tail -n +2", but Solaris apparently rejects the latter
41 install-docs:: $(MAN_PAGE).$(MAN_SECTION)
42 $(INSTALL_DIR) $(DESTDIR)$(mandir)
43 $(INSTALL_DIR) $(DESTDIR)$(mandir)/man$(MAN_SECTION)
44 $(INSTALL_MAN) $(INSTALL_OPTS) $(MAN_PAGE).$(MAN_SECTION) $(DESTDIR)$(mandir)/man$(MAN_SECTION)
48 BINDIST_EXTRAS += $(MAN_PAGE).$(MAN_SECTION)
49 include $(TOP)/mk/bindist.mk
51 include $(TOP)/mk/target.mk