Commit 19ea709e authored by Kir Kolyshkin's avatar Kir Kolyshkin Committed by Pavel Emelyanov

Doc/Makefile: add ps and pdf generation

It can be handful to check how a man page looks in PDF or Postscript.
Use 'make ps' and 'make pdf' to generate one.
Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 5e10cb73
*.xml *.xml
*.html *.html
*.[1-8] *.[1-8]
*.pdf
*.ps
...@@ -9,16 +9,34 @@ XMLS := $(patsubst %.txt,%.xml,$(SRC)) ...@@ -9,16 +9,34 @@ XMLS := $(patsubst %.txt,%.xml,$(SRC))
MANS := $(patsubst %.txt,%.8,$(SRC)) MANS := $(patsubst %.txt,%.8,$(SRC))
MAN8DIR := $(MANDIR)/man8 MAN8DIR := $(MANDIR)/man8
GROFF=groff
PAPER=$(shell paperconf 2>/dev/null || echo letter)
GROFF_OPTS := -Tps -t -dpaper=$(PAPER) -P-p$(PAPER) \
-man -msafer -rC1 -rD1 -rS11
PSS := $(MANS:%.8=%.ps)
PDFS := $(MANS:%.8=%.pdf)
all: $(MANS) all: $(MANS)
ps: $(PSS)
pdf: $(PDFS)
.PHONY: all ps pdf
%.8: %.txt %.8: %.txt
$(E) " GEN " $@ $(E) " GEN " $@
$(Q) $(ASCIIDOC) -b docbook -d manpage -o $(patsubst %.8,%.xml,$@) $< $(Q) $(ASCIIDOC) -b docbook -d manpage -o $(patsubst %.8,%.xml,$@) $<
$(Q) $(XMLTO) man --skip-validation $(patsubst %.8,%.xml,$@) 2>/dev/null $(Q) $(XMLTO) man --skip-validation $(patsubst %.8,%.xml,$@) 2>/dev/null
%.ps: %.8
$(E) " GEN " $@
$(Q) $(GROFF) $(GROFF_OPTS) $^ > $@
%.pdf: %.ps
$(E) " GEN " $@
$(Q) ps2pdf $< $@
clean: clean:
$(E) " CLEAN " $(E) " CLEAN "
$(Q) rm -f $(XMLS) $(MANS) $(Q) rm -f $(XMLS) $(MANS) $(PSS) $(PDFS)
install: $(MANS) install: $(MANS)
$(E) " INSTALL " $(MANS) $(E) " INSTALL " $(MANS)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment