diff options
author | sven.panne@aedion.de <unknown> | 2006-12-30 11:56:23 +0000 |
---|---|---|
committer | sven.panne@aedion.de <unknown> | 2006-12-30 11:56:23 +0000 |
commit | 51dec67c5368ca5d7ff44237dec51a826210c681 (patch) | |
tree | 0ad7980e5da8757ef93f165a7b59c85d15dfc06b /docs/man | |
parent | 02c48cf14cd8c7771dfb41089412f35e1eaeedd5 (diff) | |
download | haskell-51dec67c5368ca5d7ff44237dec51a826210c681.tar.gz |
Standardized Makefile for man page
Use our standard build machinery for building, installing and cleaning the
man page. Do not use deprecated -<num> option for 'head'. Use $(RM) instead
of explicit 'rm -f' for better portability.
Note that we always build/install the man page with the 'install-docs' target
now, this is the usual behaviour. "GhcManpages is dead, Jim..."
This patch should unbreak 'make dist', too.
Diffstat (limited to 'docs/man')
-rw-r--r-- | docs/man/Makefile | 48 |
1 files changed, 17 insertions, 31 deletions
diff --git a/docs/man/Makefile b/docs/man/Makefile index 63875daedd..45de7436d2 100644 --- a/docs/man/Makefile +++ b/docs/man/Makefile @@ -1,51 +1,37 @@ 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 +# The manual section +MAN_SECTION = 1 -boot: - @: +CLEAN_FILES += $(MAN_PAGE).$(MAN_SECTION) flags.xsl flags.xml -all: $(MANPAGES) - @: - -install: $(addprefix install-,$(MANPAGES)) - @: - -clean: - rm -f flags.xml flags.xsl $(UNCENSORED_MANPAGES) - -# 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 "<!DOCTYPE sect1 [<!ENTITY ndash \"-\"> \ <!ENTITY ldquo \"\`\"> \ <!ENTITY rdquo \"'\">]>" >> $@ tail -n +2 $< >> $@ -# The work for installing - -.PHONY: install-% - -install-mandir: +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-%: install-mandir $* - $(INSTALL_MAN) $* $(mandir) - +include $(TOP)/mk/target.mk |