X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=docs%2Fman%2FMakefile;h=047a348d20739bce94bed6dd36d40db03b68123c;hb=4217c6caef9f6d261df1449c590331878a493f14;hp=63875daedd8a1a0e7a54dfba6a94e2fe1a77e686;hpb=501f3c52a3fd0ce238d6be1bcc72a6c53c8e9d37;p=ghc-hetmet.git diff --git a/docs/man/Makefile b/docs/man/Makefile index 63875da..047a348 100644 --- a/docs/man/Makefile +++ b/docs/man/Makefile @@ -1,51 +1,46 @@ TOP = ../.. include $(TOP)/mk/boilerplate.mk -GHC_COMMANDS=ghc ghci +# The commands which should be mentioned in the man page +GHC_COMMANDS = ghc ghci -UNCENSORED_MANPAGES=ghc.1 +# The man page we are generating +MAN_PAGE = ghc -ifeq '$(GhcManpages)' 'YES' -MANPAGES=$(UNCENSORED_MANPAGES) -else -MANPAGES= -endif - -boot: - @: - -all: $(MANPAGES) - @: +# The manual section +MAN_SECTION = 1 -install: $(addprefix install-,$(MANPAGES)) - @: +CLEAN_FILES += $(MAN_PAGE).$(MAN_SECTION) flags.xsl flags.xml -clean: - rm -f flags.xml flags.xsl $(UNCENSORED_MANPAGES) +ifneq "$(DOING_BIN_DIST)" "YES" -# The work for building - -ghc.1: flags.xsl flags.xml +$(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)" > $@ +# 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. flags.xml: ../users_guide/flags.xml - rm -f $@ - head -1 $< >> $@ + $(RM) $@ + head -n 1 $< >> $@ echo " \ \ ]>" >> $@ tail -n +2 $< >> $@ -# The work for installing - -.PHONY: install-% +endif -install-mandir: - $(INSTALL_DIR) $(mandir) +install-docs:: $(MAN_PAGE).$(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) -install-%: install-mandir $* - $(INSTALL_MAN) $* $(mandir) +binary-dist:: $(MAN_PAGE).$(MAN_SECTION) + $(MKDIRHIER) $(BIN_DIST_DIR)/docs/man + cp Makefile $(BIN_DIST_DIR)/docs/man/ + cp $(MAN_PAGE).$(MAN_SECTION) $(BIN_DIST_DIR)/docs/man/ +include $(TOP)/mk/target.mk