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