1MAN1_TXT=$(wildcard git-*.txt) gitk.txt
2MAN7_TXT=git.txt
34
DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN7_TXT))
5DOC_HTML += glossary.html
6DOC_HTML += tutorial.html
7DOC_HTML += howto-index.html
8DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT))
9DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT))
1011
prefix=$(HOME)
12bin=$(prefix)/bin
13mandir=$(prefix)/man
14man1=$(mandir)/man1
15man7=$(mandir)/man7
16# DESTDIR=
1718
INSTALL=install
1920
#
21# Please note that there is a minor bug in asciidoc.
22# The version after 6.0.3 _will_ include the patch found here:
23# http://marc.theaimsgroup.com/?l=git&m=111558757202243&w=2
24#
25# Until that version is released you may have to apply the patch
26# yourself - yes, all 6 characters of it!
27#
2829
all: html man
3031
html: $(DOC_HTML)
3233
34
man: man1 man7
35man1: $(DOC_MAN1)
36man7: $(DOC_MAN7)
3738
install:
39$(INSTALL) -m755 -d $(DESTDIR)/$(man1) $(DESTDIR)/$(man7)
40$(INSTALL) $(DOC_MAN1) $(DESTDIR)/$(man1)
41$(INSTALL) $(DOC_MAN7) $(DESTDIR)/$(man7)
4243
# 'include' dependencies
44git-diff-%.txt: diff-format.txt diff-options.txt
45touch $@
4647
clean:
48rm -f *.xml *.html *.1 *.7 howto-index.txt
4950
%.html : %.txt
51asciidoc -b xhtml11 -d manpage $<
5253
%.1 %.7 : %.xml
54xmlto man $<
5556
%.xml : %.txt
57asciidoc -b docbook -d manpage $<
5859
glossary.html : glossary.txt sort_glossary.pl
60cat $< | \
61perl sort_glossary.pl | \
62asciidoc -b xhtml11 - > glossary.html
6364
tutorial.html : tutorial.txt
65asciidoc -b xhtml11 tutorial.txt
6667
howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
68rm -f $@+ $@
69sh ./howto-index.sh $(wildcard howto/*.txt) >$@+
70mv $@+ $@
7172
howto-index.html: howto-index.txt
73asciidoc -b xhtml11 howto-index.txt
7475
WEBDOC_DEST = /pub/software/scm/git/docs
7677
install-webdoc : html
78sh ./install-webdoc.sh $(WEBDOC_DEST)