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