4798933a493e56de73dd5ea6b560d2bcc5742843
[git.git] / Documentation / Makefile
1 MAN1_TXT=$(wildcard git-*.txt)
2 MAN7_TXT=git.txt
3
4 DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN7_TXT))
5
6 DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT))
7 DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT))
8
9 prefix=$(HOME)
10 bin=$(prefix)/bin
11 mandir=$(prefix)/man
12 man1=$(mandir)/man1
13 man7=$(mandir)/man7
14
15 INSTALL=install
16
17 #
18 # Please note that there is a minor bug in asciidoc.
19 # The version after 6.0.3 _will_ include the patch found here:
20 #   http://marc.theaimsgroup.com/?l=git&m=111558757202243&w=2
21 #
22 # Until that version is released you may have to apply the patch
23 # yourself - yes, all 6 characters of it!
24 #
25
26 all: html man
27
28 html: $(DOC_HTML)
29
30
31 man: man1 man7
32 man1: $(DOC_MAN1)
33 man7: $(DOC_MAN7)
34
35 install:
36         $(INSTALL) -m755 -d $(dest)/$(man1) $(dest)/$(man7)
37         $(INSTALL) $(DOC_MAN1) $(dest)/$(man1)
38         $(INSTALL) $(DOC_MAN7) $(dest)/$(man7)
39
40 # 'include' dependencies
41 git-diff-%.txt: diff-format.txt diff-options.txt
42         touch $@
43
44 clean:
45         rm -f *.xml *.html *.1 *.7
46
47 %.html : %.txt
48         asciidoc -b xhtml11 -d manpage $<
49
50 %.1 %.7 : %.xml
51         xmlto man $<
52
53 %.xml : %.txt
54         asciidoc -b docbook -d manpage $<