Documentation/Makefile: make most operations "quiet"
This adapts the "quiet make" implementation from the main Makefile. Signed-off-by: Chris Johnsen <chris_johnsen@pobox.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Chris Johnsen committed
Mar 27, 2009 at 01:49 UTC
bb2300976ba1491a54dc2b82819fae68d59d6e53
1 file changed
+55
-29
Documentation/Makefile
+55
-29
@@ -76,6 +76,32 @@ endif
76
# yourself - yes, all 6 characters of it!
77
#
78
79
+QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir
80
+QUIET_SUBDIR1 =
81
+
82
+ifneq ($(findstring $(MAKEFLAGS),w),w)
83
+PRINT_DIR = --no-print-directory
84
+else # "make -w"
85
+NO_SUBDIR = :
86
+endif
87
+
88
+ifneq ($(findstring $(MAKEFLAGS),s),s)
89
+ifndef V
90
+ QUIET_ASCIIDOC = @echo ' ' ASCIIDOC $@;
91
+ QUIET_XMLTO = @echo ' ' XMLTO $@;
92
+ QUIET_DB2TEXI = @echo ' ' DB2TEXI $@;
93
+ QUIET_MAKEINFO = @echo ' ' MAKEINFO $@;
94
+ QUIET_DBLATEX = @echo ' ' DBLATEX $@;
95
+ QUIET_XSLTPROC = @echo ' ' XSLTPROC $@;
96
+ QUIET_GEN = @echo ' ' GEN $@;
97
+ QUIET_STDERR = 2> /dev/null
98
+ QUIET_SUBDIR0 = +@subdir=
99
+ QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
100
+ $(MAKE) $(PRINT_DIR) -C $$subdir
101
+ export V
102
+endif
103
+endif
104
+
105
all: html man
106
107
html: $(DOC_HTML)
@@ -119,7 +145,7 @@ install-html: html
145
sh ./install-webdoc.sh $(DESTDIR)$(htmldir)
146
147
../GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
122
- $(MAKE) -C ../ GIT-VERSION-FILE
148
+ $(QUIET_SUBDIR0)../ $(QUIET_SUBDIR1) GIT-VERSION-FILE
149
150
-include ../GIT-VERSION-FILE
151
@@ -127,8 +153,8 @@ install-html: html
153
# Determine "include::" file references in asciidoc files.
154
#
155
doc.dep : $(wildcard *.txt) build-docdep.perl
130
- $(RM) $@+ $@
131
- $(PERL_PATH) ./build-docdep.perl >$@+
156
+ $(QUIET_GEN)$(RM) $@+ $@ && \
157
+ $(PERL_PATH) ./build-docdep.perl >$@+ $(QUIET_STDERR) && \
158
mv $@+ $@
159
160
-include doc.dep
@@ -146,8 +172,8 @@ cmds_txt = cmds-ancillaryinterrogators.txt \
172
$(cmds_txt): cmd-list.made
173
174
cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT)
149
- $(RM) $@
150
- $(PERL_PATH) ./cmd-list.perl ../command-list.txt
175
+ $(QUIET_GEN)$(RM) $@ && \
176
+ $(PERL_PATH) ./cmd-list.perl ../command-list.txt $(QUIET_STDERR) && \
177
date >$@
178
179
clean:
@@ -158,79 +184,79 @@ clean:
184
$(RM) $(cmds_txt) *.made
185
186
$(MAN_HTML): %.html : %.txt
161
- $(RM) $@+ $@
187
+ $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
188
$(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \
163
- $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $<
189
+ $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< && \
190
mv $@+ $@
191
192
%.1 %.5 %.7 : %.xml
167
- $(RM) $@
193
+ $(QUIET_XMLTO)$(RM) $@ && \
194
xmlto -m $(MANPAGE_XSL) man $<
195
196
%.xml : %.txt
171
- $(RM) $@+ $@
197
+ $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
198
$(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
173
- $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $<
199
+ $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< && \
200
mv $@+ $@
201
202
user-manual.xml: user-manual.txt user-manual.conf
177
- $(ASCIIDOC) -b docbook -d book $<
203
+ $(QUIET_ASCIIDOC)$(ASCIIDOC) -b docbook -d book $<
204
205
technical/api-index.txt: technical/api-index-skel.txt \
206
technical/api-index.sh $(patsubst %,%.txt,$(API_DOCS))
181
- cd technical && sh ./api-index.sh
207
+ $(QUIET_GEN)cd technical && sh ./api-index.sh
208
209
$(patsubst %,%.html,$(API_DOCS) technical/api-index): %.html : %.txt
184
- $(ASCIIDOC) -b xhtml11 -f asciidoc.conf \
210
+ $(QUIET_ASCIIDOC)$(ASCIIDOC) -b xhtml11 -f asciidoc.conf \
211
$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) $*.txt
212
213
XSLT = docbook.xsl
214
XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css
215
216
user-manual.html: user-manual.xml
191
- xsltproc $(XSLTOPTS) -o $@ $(XSLT) $<
217
+ $(QUIET_XSLTPROC)xsltproc $(XSLTOPTS) -o $@ $(XSLT) $<
218
219
git.info: user-manual.texi
194
- $(MAKEINFO) --no-split -o $@ user-manual.texi
220
+ $(QUIET_MAKEINFO)$(MAKEINFO) --no-split -o $@ user-manual.texi
221
222
user-manual.texi: user-manual.xml
197
- $(RM) $@+ $@
223
+ $(QUIET_DB2TEXI)$(RM) $@+ $@ && \
224
$(DOCBOOK2X_TEXI) user-manual.xml --encoding=UTF-8 --to-stdout | \
199
- $(PERL_PATH) fix-texi.perl >$@+
225
+ $(PERL_PATH) fix-texi.perl >$@+ && \
226
mv $@+ $@
227
228
user-manual.pdf: user-manual.xml
203
- $(RM) $@+ $@
204
- $(DBLATEX) -o $@+ -p /etc/asciidoc/dblatex/asciidoc-dblatex.xsl -s /etc/asciidoc/dblatex/asciidoc-dblatex.sty $<
229
+ $(QUIET_DBLATEX)$(RM) $@+ $@ && \
230
+ $(DBLATEX) -o $@+ -p /etc/asciidoc/dblatex/asciidoc-dblatex.xsl -s /etc/asciidoc/dblatex/asciidoc-dblatex.sty $< && \
231
mv $@+ $@
232
233
gitman.texi: $(MAN_XML) cat-texi.perl
208
- $(RM) $@+ $@
234
+ $(QUIET_DB2TEXI)$(RM) $@+ $@ && \
235
($(foreach xml,$(MAN_XML),$(DOCBOOK2X_TEXI) --encoding=UTF-8 \
210
- --to-stdout $(xml);)) | $(PERL_PATH) cat-texi.perl $@ >$@+
236
+ --to-stdout $(xml) &&) true) | $(PERL_PATH) cat-texi.perl $@ >$@+ && \
237
mv $@+ $@
238
239
gitman.info: gitman.texi
214
- $(MAKEINFO) --no-split --no-validate $*.texi
240
+ $(QUIET_MAKEINFO)$(MAKEINFO) --no-split --no-validate $*.texi
241
242
$(patsubst %.txt,%.texi,$(MAN_TXT)): %.texi : %.xml
217
- $(RM) $@+ $@
218
- $(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@+
243
+ $(QUIET_DB2TEXI)$(RM) $@+ $@ && \
244
+ $(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@+ && \
245
mv $@+ $@
246
247
howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
222
- $(RM) $@+ $@
223
- sh ./howto-index.sh $(wildcard howto/*.txt) >$@+
248
+ $(QUIET_GEN)$(RM) $@+ $@ && \
249
+ sh ./howto-index.sh $(wildcard howto/*.txt) >$@+ && \
250
mv $@+ $@
251
252
$(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
227
- $(ASCIIDOC) -b xhtml11 $*.txt
253
+ $(QUIET_ASCIIDOC)$(ASCIIDOC) -b xhtml11 $*.txt
254
255
WEBDOC_DEST = /pub/software/scm/git/docs
256
257
$(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
232
- $(RM) $@+ $@
233
- sed -e '1,/^$$/d' $< | $(ASCIIDOC) -b xhtml11 - >$@+
258
+ $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
259
+ sed -e '1,/^$$/d' $< | $(ASCIIDOC) -b xhtml11 - >$@+ && \
260
mv $@+ $@
261
262
install-webdoc : html