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