1MAN1_TXT=$(wildcard git-*.txt) gitk.txt
2MAN7_TXT=git.txt
3
4DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN7_TXT))
5
6ARTICLES = tutorial
7ARTICLES += core-tutorial
8ARTICLES += cvs-migration
9ARTICLES += diffcore
10ARTICLES += howto-index
11ARTICLES += repository-layout
12ARTICLES += hooks
13ARTICLES += everyday
14# with their own formatting rules.
15SP_ARTICLES = glossary howto/revert-branch-rebase
16
17DOC_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES))
18
19DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT))
20DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT))
21
22prefix?=$(HOME)
23bin=$(prefix)/bin
24mandir=$(prefix)/man
25man1=$(mandir)/man1
26man7=$(mandir)/man7
27# DESTDIR=
28
29INSTALL?=install
30
31#
32# Please note that there is a minor bug in asciidoc.
33# The version after 6.0.3 _will_ include the patch found here:
34# http://marc.theaimsgroup.com/?l=git&m=111558757202243&w=2
35#
36# Until that version is released you may have to apply the patch
37# yourself - yes, all 6 characters of it!
38#
39
40all: html man
41
42html: $(DOC_HTML)
43
44
45man: man1 man7
46man1: $(DOC_MAN1)
47man7: $(DOC_MAN7)
48
49install: man
50 $(INSTALL) -d -m755 $(DESTDIR)/$(man1) $(DESTDIR)/$(man7)
51 $(INSTALL) $(DOC_MAN1) $(DESTDIR)/$(man1)
52 $(INSTALL) $(DOC_MAN7) $(DESTDIR)/$(man7)
53
54
55#
56# Determine "include::" file references in asciidoc files.
57#
58doc.dep : $(wildcard *.txt) build-docdep.perl
59 rm -f $@+ $@
60 perl ./build-docdep.perl >$@+
61 mv $@+ $@
62
63-include doc.dep
64
65git.7: ../README
66
67
68clean:
69 rm -f *.xml *.html *.1 *.7 howto-index.txt howto/*.html doc.dep
70
71%.html : %.txt
72 asciidoc -b xhtml11 -d manpage -f asciidoc.conf $<
73
74%.1 %.7 : %.xml
75 xmlto man $<
76
77%.xml : %.txt
78 asciidoc -b docbook -d manpage -f asciidoc.conf $<
79
80git.html: git.txt ../README
81
82glossary.html : glossary.txt sort_glossary.pl
83 cat $< | \
84 perl sort_glossary.pl | \
85 asciidoc -b xhtml11 - > glossary.html
86
87howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
88 rm -f $@+ $@
89 sh ./howto-index.sh $(wildcard howto/*.txt) >$@+
90 mv $@+ $@
91
92$(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
93 asciidoc -b xhtml11 $*.txt
94
95WEBDOC_DEST = /pub/software/scm/git/docs
96
97$(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
98 rm -f $@+ $@
99 sed -e '1,/^$$/d' $? | asciidoc -b xhtml11 - >$@+
100 mv $@+ $@
101
102install-webdoc : html
103 sh ./install-webdoc.sh $(WEBDOC_DEST)