| 1 |
MAN1_TXT=$(wildcard cset*.txt) |
| 2 |
|
| 3 |
DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN7_TXT)) |
| 4 |
|
| 5 |
ARTICLES = |
| 6 |
|
| 7 |
SP_ARTICLES = tutorial |
| 8 |
|
| 9 |
DOC_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES)) |
| 10 |
DOC_PDF += $(patsubst %,%.pdf,$(ARTICLES) $(SP_ARTICLES)) |
| 11 |
|
| 12 |
DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT)) |
| 13 |
DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT)) |
| 14 |
|
| 15 |
prefix?=$(HOME)/man |
| 16 |
mandir?=$(prefix) |
| 17 |
man1dir=$(mandir)/man1 |
| 18 |
|
| 19 |
|
| 20 |
ASCIIDOC=asciidoc --unsafe |
| 21 |
ASCIIDOC_EXTRA = |
| 22 |
INSTALL?=install |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
all: html man |
| 34 |
|
| 35 |
html: $(DOC_HTML) |
| 36 |
pdf: $(DOC_PDF) |
| 37 |
|
| 38 |
$(DOC_HTML) $(DOC_MAN1) $(DOC_MAN7): asciidoc.conf |
| 39 |
|
| 40 |
man: man1 |
| 41 |
man1: $(DOC_MAN1) |
| 42 |
|
| 43 |
install: man |
| 44 |
$(INSTALL) -d -m755 $(DESTDIR)$(man1dir) |
| 45 |
$(INSTALL) -m644 $(DOC_MAN1) $(DESTDIR)$(man1dir) |
| 46 |
cd $(DESTDIR)$(man1dir); gzip *.1 |
| 47 |
|
| 48 |
-include doc.dep |
| 49 |
|
| 50 |
clean: |
| 51 |
rm -f *.xml *.pdf doc.dep |
| 52 |
#rm -f *.xml *.html *.pdf *.1 *.7 doc.dep |
| 53 |
|
| 54 |
%.html : %.txt |
| 55 |
$(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf $(ASCIIDOC_EXTRA) $< |
| 56 |
|
| 57 |
%.1 %.7 : %.xml |
| 58 |
xmlto -m callouts.xsl man $< |
| 59 |
|
| 60 |
%.xml : %.txt |
| 61 |
$(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf $< |
| 62 |
|
| 63 |
%.pdf: %.xml |
| 64 |
xmlto pdf $< |
| 65 |
|
| 66 |
|
| 67 |
tutorial.html : %.html : %.txt |
| 68 |
$(ASCIIDOC) -b xhtml11 -d article -f tutorial.conf -a toc -a numbered -a toclevels=4 $(ASCIIDOC_EXTRA) $< |
| 69 |
tutorial.xml : %.xml : %.txt |
| 70 |
$(ASCIIDOC) -b docbook -d article -f tutorial.conf $< |