Merge branch 'master' of git://git.kernel.org/pub/scm/gitk/gitk
[git/jrn.git] / Documentation / Makefile
blobfbefe9a45b00a54b58d94d06eca48b03d40a50e0
1 MAN1_TXT= \
2 $(filter-out $(addsuffix .txt, $(ARTICLES) $(SP_ARTICLES)), \
3 $(wildcard git-*.txt)) \
4 gitk.txt
5 MAN5_TXT=gitattributes.txt gitignore.txt gitmodules.txt
6 MAN7_TXT=git.txt
8 DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT))
10 ARTICLES = tutorial
11 ARTICLES += tutorial-2
12 ARTICLES += core-tutorial
13 ARTICLES += cvs-migration
14 ARTICLES += diffcore
15 ARTICLES += howto-index
16 ARTICLES += repository-layout
17 ARTICLES += hooks
18 ARTICLES += everyday
19 ARTICLES += git-tools
20 ARTICLES += glossary
21 # with their own formatting rules.
22 SP_ARTICLES = howto/revert-branch-rebase user-manual
24 DOC_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES))
26 DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT))
27 DOC_MAN5=$(patsubst %.txt,%.5,$(MAN5_TXT))
28 DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT))
30 prefix?=$(HOME)
31 bindir?=$(prefix)/bin
32 mandir?=$(prefix)/share/man
33 man1dir=$(mandir)/man1
34 man5dir=$(mandir)/man5
35 man7dir=$(mandir)/man7
36 # DESTDIR=
38 ASCIIDOC=asciidoc
39 ASCIIDOC_EXTRA =
40 ifdef ASCIIDOC8
41 ASCIIDOC_EXTRA += -a asciidoc7compatible
42 endif
43 INSTALL?=install
44 RM ?= rm -f
45 DOC_REF = origin/man
47 infodir?=$(prefix)/share/info
48 MAKEINFO=makeinfo
49 INSTALL_INFO=install-info
50 DOCBOOK2X_TEXI=docbook2x-texi
52 -include ../config.mak.autogen
53 -include ../config.mak
56 # Please note that there is a minor bug in asciidoc.
57 # The version after 6.0.3 _will_ include the patch found here:
58 # http://marc.theaimsgroup.com/?l=git&m=111558757202243&w=2
60 # Until that version is released you may have to apply the patch
61 # yourself - yes, all 6 characters of it!
64 all: html man
66 html: $(DOC_HTML)
68 $(DOC_HTML) $(DOC_MAN1) $(DOC_MAN5) $(DOC_MAN7): asciidoc.conf
70 man: man1 man5 man7
71 man1: $(DOC_MAN1)
72 man5: $(DOC_MAN5)
73 man7: $(DOC_MAN7)
75 info: git.info
77 install: man
78 $(INSTALL) -d -m755 $(DESTDIR)$(man1dir)
79 $(INSTALL) -d -m755 $(DESTDIR)$(man5dir)
80 $(INSTALL) -d -m755 $(DESTDIR)$(man7dir)
81 $(INSTALL) -m644 $(DOC_MAN1) $(DESTDIR)$(man1dir)
82 $(INSTALL) -m644 $(DOC_MAN5) $(DESTDIR)$(man5dir)
83 $(INSTALL) -m644 $(DOC_MAN7) $(DESTDIR)$(man7dir)
85 install-info: info
86 $(INSTALL) -d -m755 $(DESTDIR)$(infodir)
87 $(INSTALL) -m644 git.info $(DESTDIR)$(infodir)
88 if test -r $(DESTDIR)$(infodir)/dir; then \
89 $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) git.info ;\
90 else \
91 echo "No directory found in $(DESTDIR)$(infodir)" >&2 ; \
94 ../GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
95 $(MAKE) -C ../ GIT-VERSION-FILE
97 -include ../GIT-VERSION-FILE
100 # Determine "include::" file references in asciidoc files.
102 doc.dep : $(wildcard *.txt) build-docdep.perl
103 $(RM) $@+ $@
104 perl ./build-docdep.perl >$@+
105 mv $@+ $@
107 -include doc.dep
109 cmds_txt = cmds-ancillaryinterrogators.txt \
110 cmds-ancillarymanipulators.txt \
111 cmds-mainporcelain.txt \
112 cmds-plumbinginterrogators.txt \
113 cmds-plumbingmanipulators.txt \
114 cmds-synchingrepositories.txt \
115 cmds-synchelpers.txt \
116 cmds-purehelpers.txt \
117 cmds-foreignscminterface.txt
119 $(cmds_txt): cmd-list.made
121 cmd-list.made: cmd-list.perl $(MAN1_TXT)
122 $(RM) $@
123 perl ./cmd-list.perl
124 date >$@
126 git.7 git.html: git.txt core-intro.txt
128 clean:
129 $(RM) *.xml *.xml+ *.html *.html+ *.1 *.5 *.7 *.texi *.texi+ howto-index.txt howto/*.html doc.dep
130 $(RM) $(cmds_txt) *.made
132 %.html : %.txt
133 $(RM) $@+ $@
134 $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \
135 $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $<
136 mv $@+ $@
138 %.1 %.5 %.7 : %.xml
139 $(RM) $@
140 xmlto -m callouts.xsl man $<
142 %.xml : %.txt
143 $(RM) $@+ $@
144 $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
145 $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $<
146 mv $@+ $@
148 user-manual.xml: user-manual.txt user-manual.conf
149 $(ASCIIDOC) -b docbook -d book $<
151 XSLT = docbook.xsl
152 XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css
154 user-manual.html: user-manual.xml
155 xsltproc $(XSLTOPTS) -o $@ $(XSLT) $<
157 git.info: user-manual.xml
158 $(RM) $@ $*.texi $*.texi+
159 $(DOCBOOK2X_TEXI) user-manual.xml --to-stdout >$*.texi+
160 perl fix-texi.perl <$*.texi+ >$*.texi
161 $(MAKEINFO) --no-split $*.texi
162 $(RM) $*.texi $*.texi+
164 howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
165 $(RM) $@+ $@
166 sh ./howto-index.sh $(wildcard howto/*.txt) >$@+
167 mv $@+ $@
169 $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
170 $(ASCIIDOC) -b xhtml11 $*.txt
172 WEBDOC_DEST = /pub/software/scm/git/docs
174 $(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
175 $(RM) $@+ $@
176 sed -e '1,/^$$/d' $< | $(ASCIIDOC) -b xhtml11 - >$@+
177 mv $@+ $@
179 install-webdoc : html
180 sh ./install-webdoc.sh $(WEBDOC_DEST)
182 quick-install:
183 sh ./install-doc-quick.sh $(DOC_REF) $(mandir)
185 .PHONY: .FORCE-GIT-VERSION-FILE