X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=docs%2Fman%2FMakefile;h=21e60e2df8f17f348719db09a8263399469a8de4;hb=367e603d0136436e783ff9ed610809bf87376262;hp=45de7436d2b1e78799f693eff9b3d9d45a91441f;hpb=51dec67c5368ca5d7ff44237dec51a826210c681;p=ghc-hetmet.git diff --git a/docs/man/Makefile b/docs/man/Makefile index 45de743..21e60e2 100644 --- a/docs/man/Makefile +++ b/docs/man/Makefile @@ -1,6 +1,8 @@ TOP = ../.. include $(TOP)/mk/boilerplate.mk +ifneq "$(strip $(XSLTPROC))" "" + # The commands which should be mentioned in the man page GHC_COMMANDS = ghc ghci @@ -12,12 +14,16 @@ MAN_SECTION = 1 CLEAN_FILES += $(MAN_PAGE).$(MAN_SECTION) flags.xsl flags.xml +ifneq "$(DOING_BIN_DIST)" "YES" + +all:: $(MAN_PAGE).$(MAN_SECTION) + $(MAN_PAGE).$(MAN_SECTION): flags.xsl flags.xml $(XSLTPROC) $(XSLTPROC_OPTS) flags.xsl flags.xml > $@ # Insert the commands and the library directory into the man page flags.xsl: gen_flags.xsl.pl - perl gen_flags.xsl.pl "$(GHC_COMMANDS)" "$(libdir)" > $@ + $(PERL) gen_flags.xsl.pl "$(GHC_COMMANDS)" "$(libdir)" > $@ # Re-use the flags documentation from the user's guide by injecting some # entities after the XML declaration to make it a stand-alone document. @@ -27,11 +33,18 @@ flags.xml: ../users_guide/flags.xml echo " \ \ ]>" >> $@ - tail -n +2 $< >> $@ + # "sed 1d" == "tail -n +2", but Solaris apparently rejects the latter + sed 1d $< >> $@ + +endif install-docs:: $(MAN_PAGE).$(MAN_SECTION) - $(INSTALL_DIR) $(mandir) - $(INSTALL_DIR) $(mandir)/man$(MAN_SECTION) - $(INSTALL_MAN) $(INSTALL_OPTS) $(MAN_PAGE).$(MAN_SECTION) $(mandir)/man$(MAN_SECTION) + $(INSTALL_DIR) $(DESTDIR)$(mandir) + $(INSTALL_DIR) $(DESTDIR)$(mandir)/man$(MAN_SECTION) + $(INSTALL_MAN) $(INSTALL_OPTS) $(MAN_PAGE).$(MAN_SECTION) $(DESTDIR)$(mandir)/man$(MAN_SECTION) + +endif + +include $(TOP)/mk/bindist.mk include $(TOP)/mk/target.mk