diff --git a/Documentation/.gitignore b/Documentation/.gitignore index 2d97881c2..ad3e4f05e 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 5fa2f4e70..1a98801d5 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)