2 include $(TOP)/mk/boilerplate.mk
4 # The commands which should be mentioned in the man page
5 GHC_COMMANDS = ghc ghci
7 # The man page we are generating
13 CLEAN_FILES += $(MAN_PAGE).$(MAN_SECTION) flags.xsl flags.xml
15 ifneq "$(DOING_BIN_DIST)" "YES"
17 all:: $(MAN_PAGE).$(MAN_SECTION)
19 $(MAN_PAGE).$(MAN_SECTION): flags.xsl flags.xml
20 $(XSLTPROC) $(XSLTPROC_OPTS) flags.xsl flags.xml > $@
22 # Insert the commands and the library directory into the man page
23 flags.xsl: gen_flags.xsl.pl
24 perl gen_flags.xsl.pl "$(GHC_COMMANDS)" "$(libdir)" > $@
26 # Re-use the flags documentation from the user's guide by injecting some
27 # entities after the XML declaration to make it a stand-alone document.
28 flags.xml: ../users_guide/flags.xml
31 echo "<!DOCTYPE sect1 [<!ENTITY ndash \"-\"> \
32 <!ENTITY ldquo \"\`\"> \
33 <!ENTITY rdquo \"'\">]>" >> $@
38 install-docs:: $(MAN_PAGE).$(MAN_SECTION)
39 $(INSTALL_DIR) $(DESTDIR)$(mandir)
40 $(INSTALL_DIR) $(DESTDIR)$(mandir)/man$(MAN_SECTION)
41 $(INSTALL_MAN) $(INSTALL_OPTS) $(MAN_PAGE).$(MAN_SECTION) $(DESTDIR)$(mandir)/man$(MAN_SECTION)
43 binary-dist:: $(MAN_PAGE).$(MAN_SECTION)
44 $(MKDIRHIER) $(BIN_DIST_DIR)/docs/man
45 cp Makefile $(BIN_DIST_DIR)/docs/man/
46 cp $(MAN_PAGE).$(MAN_SECTION) $(BIN_DIST_DIR)/docs/man/
48 include $(TOP)/mk/target.mk