]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/Makefile
Resurrect peek-remote
[thirdparty/git.git] / Documentation / Makefile
CommitLineData
4a5d6939
MW
1MAN1_TXT= \
2 $(filter-out $(addsuffix .txt, $(ARTICLES) $(SP_ARTICLES)), \
3 $(wildcard git-*.txt)) \
4 gitk.txt
891dbc6e 5MAN5_TXT=gitattributes.txt gitignore.txt gitmodules.txt
b2bf34d6 6MAN7_TXT=git.txt
b790abb8 7
4392da4d 8DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT))
8db9307c 9
a1d4aa74 10ARTICLES = tutorial
e31952da 11ARTICLES += tutorial-2
dcc6e28f 12ARTICLES += core-tutorial
a1d4aa74
JH
13ARTICLES += cvs-migration
14ARTICLES += diffcore
15ARTICLES += howto-index
16ARTICLES += repository-layout
6d35cc76 17ARTICLES += hooks
db9536c8 18ARTICLES += everyday
4a5d6939 19ARTICLES += git-tools
f562e6f3 20ARTICLES += glossary
8db9307c 21# with their own formatting rules.
f562e6f3 22SP_ARTICLES = howto/revert-branch-rebase user-manual
8db9307c
JH
23
24DOC_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES))
789d5774 25
b2bf34d6 26DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT))
2d76548b 27DOC_MAN5=$(patsubst %.txt,%.5,$(MAN5_TXT))
b2bf34d6
DG
28DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT))
29
d2b8593f 30prefix?=$(HOME)
e14421b9 31bindir?=$(prefix)/bin
45fd8bd3 32mandir?=$(prefix)/share/man
7b8cf0cf 33man1dir=$(mandir)/man1
4392da4d 34man5dir=$(mandir)/man5
7b8cf0cf 35man7dir=$(mandir)/man7
a682ef9f 36# DESTDIR=
87a81c83 37
1187d756 38ASCIIDOC=asciidoc
26cfcfbf 39ASCIIDOC_EXTRA =
d2b8593f 40INSTALL?=install
4cb08df5 41RM ?= rm -f
6538d1ef 42DOC_REF = origin/man
87a81c83 43
4739809c
DK
44infodir?=$(prefix)/share/info
45MAKEINFO=makeinfo
46INSTALL_INFO=install-info
47DOCBOOK2X_TEXI=docbook2x-texi
48
95676853 49-include ../config.mak.autogen
4fa96e15 50-include ../config.mak
95676853 51
7f55cf45
JF
52ifdef ASCIIDOC8
53ASCIIDOC_EXTRA += -a asciidoc7compatible
54endif
55ifdef DOCBOOK_XSL_172
56ASCIIDOC_EXTRA += -a docbook-xsl-172
57endif
58
b2bf34d6
DG
59#
60# Please note that there is a minor bug in asciidoc.
61# The version after 6.0.3 _will_ include the patch found here:
62# http://marc.theaimsgroup.com/?l=git&m=111558757202243&w=2
63#
64# Until that version is released you may have to apply the patch
65# yourself - yes, all 6 characters of it!
66#
67
68all: html man
b790abb8
DG
69
70html: $(DOC_HTML)
71
4392da4d 72$(DOC_HTML) $(DOC_MAN1) $(DOC_MAN5) $(DOC_MAN7): asciidoc.conf
b2bf34d6 73
4392da4d 74man: man1 man5 man7
b2bf34d6 75man1: $(DOC_MAN1)
4392da4d 76man5: $(DOC_MAN5)
b2bf34d6 77man7: $(DOC_MAN7)
b790abb8 78
4739809c
DK
79info: git.info
80
b163512d 81install: man
4392da4d
JH
82 $(INSTALL) -d -m755 $(DESTDIR)$(man1dir)
83 $(INSTALL) -d -m755 $(DESTDIR)$(man5dir)
84 $(INSTALL) -d -m755 $(DESTDIR)$(man7dir)
d44c92d6 85 $(INSTALL) -m644 $(DOC_MAN1) $(DESTDIR)$(man1dir)
88e7fdf2 86 $(INSTALL) -m644 $(DOC_MAN5) $(DESTDIR)$(man5dir)
d44c92d6 87 $(INSTALL) -m644 $(DOC_MAN7) $(DESTDIR)$(man7dir)
87a81c83 88
4739809c
DK
89install-info: info
90 $(INSTALL) -d -m755 $(DESTDIR)$(infodir)
91 $(INSTALL) -m644 git.info $(DESTDIR)$(infodir)
92 if test -r $(DESTDIR)$(infodir)/dir; then \
93 $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) git.info ;\
94 else \
95 echo "No directory found in $(DESTDIR)$(infodir)" >&2 ; \
96 fi
37465016 97
7b8a74f3
FL
98../GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
99 $(MAKE) -C ../ GIT-VERSION-FILE
100
101-include ../GIT-VERSION-FILE
102
93d69d86
JL
103#
104# Determine "include::" file references in asciidoc files.
105#
fb612d54 106doc.dep : $(wildcard *.txt) build-docdep.perl
4cb08df5 107 $(RM) $@+ $@
a5ae8e64
JH
108 perl ./build-docdep.perl >$@+
109 mv $@+ $@
93d69d86 110
a5ae8e64 111-include doc.dep
37465016 112
72fe6a59
JH
113cmds_txt = cmds-ancillaryinterrogators.txt \
114 cmds-ancillarymanipulators.txt \
115 cmds-mainporcelain.txt \
116 cmds-plumbinginterrogators.txt \
117 cmds-plumbingmanipulators.txt \
89bf2077
JH
118 cmds-synchingrepositories.txt \
119 cmds-synchelpers.txt \
120 cmds-purehelpers.txt \
121 cmds-foreignscminterface.txt
72fe6a59 122
d7907392
JH
123$(cmds_txt): cmd-list.made
124
125cmd-list.made: cmd-list.perl $(MAN1_TXT)
f9286765 126 $(RM) $@
72fe6a59 127 perl ./cmd-list.perl
d7907392 128 date >$@
b790abb8 129
40dac517 130git.7 git.html: git.txt
93d69d86 131
b790abb8 132clean:
4739809c 133 $(RM) *.xml *.xml+ *.html *.html+ *.1 *.5 *.7 *.texi *.texi+ howto-index.txt howto/*.html doc.dep
4cb08df5 134 $(RM) $(cmds_txt) *.made
b790abb8
DG
135
136%.html : %.txt
4cb08df5 137 $(RM) $@+ $@
7b8a74f3 138 $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \
4159c578 139 $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $<
7b8a74f3 140 mv $@+ $@
b790abb8 141
4392da4d 142%.1 %.5 %.7 : %.xml
50cff52f 143 $(RM) $@
776e994a 144 xmlto -m callouts.xsl man $<
b790abb8
DG
145
146%.xml : %.txt
4cb08df5 147 $(RM) $@+ $@
7b8a74f3 148 $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
4159c578 149 $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $<
7b8a74f3 150 mv $@+ $@
3f971fc4 151
d19fbc3c 152user-manual.xml: user-manual.txt user-manual.conf
1187d756 153 $(ASCIIDOC) -b docbook -d book $<
d19fbc3c 154
1cffddd6 155XSLT = docbook.xsl
0a3985dc 156XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css
1c95c565 157
d19fbc3c 158user-manual.html: user-manual.xml
1c95c565 159 xsltproc $(XSLTOPTS) -o $@ $(XSLT) $<
d19fbc3c 160
4739809c
DK
161git.info: user-manual.xml
162 $(RM) $@ $*.texi $*.texi+
163 $(DOCBOOK2X_TEXI) user-manual.xml --to-stdout >$*.texi+
164 perl fix-texi.perl <$*.texi+ >$*.texi
165 $(MAKEINFO) --no-split $*.texi
166 $(RM) $*.texi $*.texi+
167
e6fc2346 168howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
4cb08df5 169 $(RM) $@+ $@
e6fc2346
JH
170 sh ./howto-index.sh $(wildcard howto/*.txt) >$@+
171 mv $@+ $@
172
8db9307c 173$(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
1187d756 174 $(ASCIIDOC) -b xhtml11 $*.txt
e6fc2346
JH
175
176WEBDOC_DEST = /pub/software/scm/git/docs
177
8d0991d7 178$(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
4cb08df5 179 $(RM) $@+ $@
1187d756 180 sed -e '1,/^$$/d' $< | $(ASCIIDOC) -b xhtml11 - >$@+
8d0991d7
JH
181 mv $@+ $@
182
e6fc2346
JH
183install-webdoc : html
184 sh ./install-webdoc.sh $(WEBDOC_DEST)
6538d1ef
EW
185
186quick-install:
187 sh ./install-doc-quick.sh $(DOC_REF) $(mandir)
7b8a74f3
FL
188
189.PHONY: .FORCE-GIT-VERSION-FILE