Merge branch 'maint'
[git/jnareb-git/bp-gitweb.git] / Documentation / Makefile
blob9cef4806d1a51bac670ebe192a4482fde95c9013
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
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)/man
33 man1dir=$(mandir)/man1
34 man5dir=$(mandir)/man5
35 man7dir=$(mandir)/man7
36 # DESTDIR=
38 ASCIIDOC=asciidoc
39 ASCIIDOC_EXTRA =
40 INSTALL?=install
41 DOC_REF = origin/man
43 -include ../config.mak.autogen
44 -include ../config.mak
47 # Please note that there is a minor bug in asciidoc.
48 # The version after 6.0.3 _will_ include the patch found here:
49 # http://marc.theaimsgroup.com/?l=git&m=111558757202243&w=2
51 # Until that version is released you may have to apply the patch
52 # yourself - yes, all 6 characters of it!
55 all: html man
57 html: $(DOC_HTML)
59 $(DOC_HTML) $(DOC_MAN1) $(DOC_MAN5) $(DOC_MAN7): asciidoc.conf
61 man: man1 man5 man7
62 man1: $(DOC_MAN1)
63 man5: $(DOC_MAN5)
64 man7: $(DOC_MAN7)
66 install: man
67 $(INSTALL) -d -m755 $(DESTDIR)$(man1dir)
68 $(INSTALL) -d -m755 $(DESTDIR)$(man5dir)
69 $(INSTALL) -d -m755 $(DESTDIR)$(man7dir)
70 $(INSTALL) -m644 $(DOC_MAN1) $(DESTDIR)$(man1dir)
71 $(INSTALL) -m644 $(DOC_MAN5) $(DESTDIR)$(man5dir)
72 $(INSTALL) -m644 $(DOC_MAN7) $(DESTDIR)$(man7dir)
75 ../GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
76 $(MAKE) -C ../ GIT-VERSION-FILE
78 -include ../GIT-VERSION-FILE
81 # Determine "include::" file references in asciidoc files.
83 doc.dep : $(wildcard *.txt) build-docdep.perl
84 rm -f $@+ $@
85 perl ./build-docdep.perl >$@+
86 mv $@+ $@
88 -include doc.dep
90 cmds_txt = cmds-ancillaryinterrogators.txt \
91 cmds-ancillarymanipulators.txt \
92 cmds-mainporcelain.txt \
93 cmds-plumbinginterrogators.txt \
94 cmds-plumbingmanipulators.txt \
95 cmds-synchingrepositories.txt \
96 cmds-synchelpers.txt \
97 cmds-purehelpers.txt \
98 cmds-foreignscminterface.txt
100 $(cmds_txt): cmd-list.made
102 cmd-list.made: cmd-list.perl $(MAN1_TXT)
103 perl ./cmd-list.perl
104 date >$@
106 git.7 git.html: git.txt core-intro.txt
108 clean:
109 rm -f *.xml *.xml+ *.html *.html+ *.1 *.5 *.7 howto-index.txt howto/*.html doc.dep
110 rm -f $(cmds_txt) *.made
112 %.html : %.txt
113 rm -f $@+ $@
114 $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \
115 $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $<
116 mv $@+ $@
118 %.1 %.5 %.7 : %.xml
119 xmlto -m callouts.xsl man $<
121 %.xml : %.txt
122 rm -f $@+ $@
123 $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
124 $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $<
125 mv $@+ $@
127 user-manual.xml: user-manual.txt user-manual.conf
128 $(ASCIIDOC) -b docbook -d book $<
130 XSLT = http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl
131 XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css
133 user-manual.html: user-manual.xml
134 xsltproc $(XSLTOPTS) -o $@ $(XSLT) $<
136 howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
137 rm -f $@+ $@
138 sh ./howto-index.sh $(wildcard howto/*.txt) >$@+
139 mv $@+ $@
141 $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
142 $(ASCIIDOC) -b xhtml11 $*.txt
144 WEBDOC_DEST = /pub/software/scm/git/docs
146 $(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
147 rm -f $@+ $@
148 sed -e '1,/^$$/d' $< | $(ASCIIDOC) -b xhtml11 - >$@+
149 mv $@+ $@
151 install-webdoc : html
152 sh ./install-webdoc.sh $(WEBDOC_DEST)
154 quick-install:
155 sh ./install-doc-quick.sh $(DOC_REF) $(mandir)
157 .PHONY: .FORCE-GIT-VERSION-FILE