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