chiark / gitweb /
Refuse to send empty patches
[stgit] / Documentation / Makefile
CommitLineData
36043cd6
CM
1MAN1_TXT=$(wildcard stg*.txt)
2MAN7_TXT=
4ec67741
YD
3
4DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN7_TXT))
5
368a44c3
YD
6ARTICLES =
7# with their own formatting rules.
8SP_ARTICLES = tutorial
9
10DOC_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES))
11DOC_PDF += $(patsubst %,%.pdf,$(ARTICLES) $(SP_ARTICLES))
12
4ec67741
YD
13DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT))
14DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT))
15
16prefix?=$(HOME)
17mandir?=$(prefix)/man
18man1dir=$(mandir)/man1
19man7dir=$(mandir)/man7
20# DESTDIR=
21
22ASCIIDOC=asciidoc --unsafe
23ASCIIDOC_EXTRA =
24INSTALL?=install
25
26#
27# Please note that there is a minor bug in asciidoc.
28# The version after 6.0.3 _will_ include the patch found here:
29# http://marc.theaimsgroup.com/?l=git&m=111558757202243&w=2
30#
31# Until that version is released you may have to apply the patch
32# yourself - yes, all 6 characters of it!
33#
34
35all: html man
36
37html: $(DOC_HTML)
368a44c3 38pdf: $(DOC_PDF)
4ec67741
YD
39
40$(DOC_HTML) $(DOC_MAN1) $(DOC_MAN7): asciidoc.conf
41
42man: man1 man7
43man1: $(DOC_MAN1)
44man7: $(DOC_MAN7)
45
46install: man
47 $(INSTALL) -d -m755 $(DESTDIR)$(man1dir) $(DESTDIR)$(man7dir)
48 $(INSTALL) -m644 $(DOC_MAN1) $(DESTDIR)$(man1dir)
49 $(INSTALL) -m644 $(DOC_MAN7) $(DESTDIR)$(man7dir)
50#
51# Determine "include::" file references in asciidoc files.
52#
53doc.dep : $(wildcard *.txt) build-docdep.perl
54 rm -f $@+ $@
55 perl ./build-docdep.perl >$@+
56 mv $@+ $@
57
58-include doc.dep
59
60clean:
368a44c3 61 rm -f *.xml *.html *.pdf *.1 *.7 doc.dep
4ec67741
YD
62
63%.html : %.txt
64 $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf $(ASCIIDOC_EXTRA) $<
65
66%.1 %.7 : %.xml
67 xmlto -m callouts.xsl man $<
68
69%.xml : %.txt
70 $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf $<
368a44c3
YD
71
72%.pdf: %.xml
73 xmlto pdf $<
74
75# special formatting rules
76tutorial.html : %.html : %.txt
77 $(ASCIIDOC) -b xhtml11 -d article -f tutorial.conf $(ASCIIDOC_EXTRA) $<
78tutorial.xml : %.xml : %.txt
79 $(ASCIIDOC) -b docbook -d article -f tutorial.conf $<