stgit.el: Set patch names to be word syntax throughout
[stgit] / Documentation / Makefile
... / ...
CommitLineData
1COMMANDS = $(shell ../stg-build --commands)
2COMMANDS_TXT = $(patsubst %,stg-%.txt,$(COMMANDS))
3
4MAN1_TXT= stg.txt $(COMMANDS_TXT)
5
6DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT))
7
8ARTICLES = tutorial
9
10DOC_HTML += $(patsubst %,%.html,$(ARTICLES))
11DOC_PDF += $(patsubst %,%.pdf,$(ARTICLES))
12
13DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT))
14
15prefix?=$(HOME)
16htmldir?=$(prefix)/share/doc/stgit
17mandir?=$(prefix)/share/man
18man1dir=$(mandir)/man1
19# DESTDIR=
20
21ASCIIDOC=asciidoc --unsafe
22ASCIIDOC_EXTRA =
23INSTALL?=install
24
25#
26# Please note that there is a minor bug in asciidoc.
27# The version after 6.0.3 _will_ include the patch found here:
28# http://marc.theaimsgroup.com/?l=git&m=111558757202243&w=2
29#
30# Until that version is released you may have to apply the patch
31# yourself - yes, all 6 characters of it!
32#
33
34all: html man
35
36html: $(DOC_HTML)
37pdf: $(DOC_PDF)
38
39$(DOC_HTML) $(DOC_MAN1): asciidoc.conf
40
41man: man1
42man1: $(DOC_MAN1)
43install: man
44 $(INSTALL) -d -m755 $(DESTDIR)$(man1dir)
45 $(INSTALL) -m644 $(DOC_MAN1) $(DESTDIR)$(man1dir)
46
47install-html: html
48 $(INSTALL) -d -m755 $(DESTDIR)$(htmldir)
49 $(INSTALL) -m644 $(DOC_HTML) $(DESTDIR)$(htmldir)
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:
61 rm -f *.xml *.html *.pdf *.1 doc.dep $(COMMANDS_TXT) command-list.txt
62
63ALL_PY = $(shell find ../stgit -name '*.py')
64
65$(COMMANDS_TXT): $(ALL_PY)
66 ../stg-build --asciidoc $(basename $(subst stg-,,$@)) > $@
67
68command-list.txt: $(ALL_PY)
69 ../stg-build --cmd-list > $@
70
71%.html : %.txt
72 $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf $(ASCIIDOC_EXTRA) $<
73
74%.1 : %.xml
75 xmlto -m callouts.xsl man $<
76
77%.xml : %.txt
78 $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf $<
79
80%.pdf: %.xml
81 xmlto pdf $<
82
83# special formatting rules
84tutorial.html : %.html : %.txt
85 $(ASCIIDOC) -b xhtml11 -d article -a toc -f tutorial.conf \
86 $(ASCIIDOC_EXTRA) $<
87tutorial.xml : %.xml : %.txt
88 $(ASCIIDOC) -b docbook -d article -f tutorial.conf $<