projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make TcBinds warning-free
[ghc-hetmet.git]
/
docs
/
man
/
Makefile
diff --git
a/docs/man/Makefile
b/docs/man/Makefile
index
63875da
..
7fa112d
100644
(file)
--- a/
docs/man/Makefile
+++ b/
docs/man/Makefile
@@
-1,51
+1,55
@@
TOP = ../..
include $(TOP)/mk/boilerplate.mk
TOP = ../..
include $(TOP)/mk/boilerplate.mk
-GHC_COMMANDS=ghc ghci
+ifneq "$(strip $(XSLTPROC))" ""
-UNCENSORED_MANPAGES=ghc.1
+# The commands which should be mentioned in the man page
+GHC_COMMANDS = ghc ghci
-ifeq '$(GhcManpages)' 'YES'
-MANPAGES=$(UNCENSORED_MANPAGES)
-else
-MANPAGES=
-endif
-
-boot:
- @:
+# The man page we are generating
+MAN_PAGE = ghc
-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
+all:: $(MAN_PAGE).$(MAN_SECTION)
-ghc.1: flags.xsl flags.xml
+$(MAN_PAGE).$(MAN_SECTION): flags.xsl flags.xml
$(XSLTPROC) $(XSLTPROC_OPTS) 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)" > $@
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
flags.xml: ../users_guide/flags.xml
- rm -f $@
- head -1 $< >> $@
+ $(RM) $@
+ head -n 1 $< >> $@
echo "<!DOCTYPE sect1 [<!ENTITY ndash \"-\"> \
<!ENTITY ldquo \"\`\"> \
<!ENTITY rdquo \"'\">]>" >> $@
echo "<!DOCTYPE sect1 [<!ENTITY ndash \"-\"> \
<!ENTITY ldquo \"\`\"> \
<!ENTITY rdquo \"'\">]>" >> $@
- tail -n +2 $< >> $@
+ # "sed 1d" == "tail -n +2", but Solaris apparently rejects the latter
+ sed 1d $< >> $@
-# The work for installing
+endif
-.PHONY: install-%
+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-mandir:
- $(INSTALL_DIR) $(mandir)
+endif
-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/
+ifneq "$(strip $(XSLTPROC))" ""
+ cp $(MAN_PAGE).$(MAN_SECTION) $(BIN_DIST_DIR)/docs/man/
+endif
+include $(TOP)/mk/target.mk