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