[CRIU] [PATCH 2/2] Doc/Makefile: add ps and pdf generation
Kir Kolyshkin
kir at openvz.org
Wed Jan 8 19:34:38 PST 2014
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: Kir Kolyshkin <kir at openvz.org>
---
Documentation/.gitignore | 2 ++
Documentation/Makefile | 20 +++++++++++++++++++-
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/Documentation/.gitignore b/Documentation/.gitignore
index 2d97881..ad3e4f0 100644
--- a/Documentation/.gitignore
+++ b/Documentation/.gitignore
@@ -1,3 +1,5 @@
*.xml
*.html
*.[1-8]
+*.pdf
+*.ps
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 5fa2f4e..1a98801 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -9,16 +9,34 @@ XMLS := $(patsubst %.txt,%.xml,$(SRC))
MANS := $(patsubst %.txt,%.8,$(SRC))
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)
+ps: $(PSS)
+pdf: $(PDFS)
+.PHONY: all ps pdf
%.8: %.txt
$(E) " GEN " $@
$(Q) $(ASCIIDOC) -b docbook -d manpage -o $(patsubst %.8,%.xml,$@) $<
$(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:
$(E) " CLEAN "
- $(Q) rm -f $(XMLS) $(MANS)
+ $(Q) rm -f $(XMLS) $(MANS) $(PSS) $(PDFS)
install: $(MANS)
$(E) " INSTALL " $(MANS)
--
1.8.1.4
More information about the CRIU
mailing list