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