76
76
# yourself - yes, all 6 characters of it!
77
77
#
78
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
+
79
105
all : html man
80
106
81
107
html : $(DOC_HTML )
@@ -119,16 +145,16 @@ install-html: html
119
145
sh ./install-webdoc.sh $(DESTDIR )$(htmldir )
120
146
121
147
../GIT-VERSION-FILE : .FORCE-GIT-VERSION-FILE
122
- $(MAKE ) -C ../ GIT-VERSION-FILE
148
+ $(QUIET_SUBDIR0 ) ../ $( QUIET_SUBDIR1 ) GIT-VERSION-FILE
123
149
124
150
-include ../GIT-VERSION-FILE
125
151
126
152
#
127
153
# Determine "include::" file references in asciidoc files.
128
154
#
129
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 ) && \
132
158
mv $@ + $@
133
159
134
160
-include doc.dep
@@ -146,8 +172,8 @@ cmds_txt = cmds-ancillaryinterrogators.txt \
146
172
$(cmds_txt ) : cmd-list.made
147
173
148
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 ) && \
151
177
date > $@
152
178
153
179
clean :
@@ -158,79 +184,79 @@ clean:
158
184
$(RM ) $(cmds_txt ) * .made
159
185
160
186
$(MAN_HTML ) : % .html : % .txt
161
- $(RM ) $@ + $@
187
+ $(QUIET_ASCIIDOC )$( RM ) $@ + $@ && \
162
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 $@ + $< && \
164
190
mv $@ + $@
165
191
166
192
% .1 % .5 % .7 : % .xml
167
- $(RM ) $@
193
+ $(QUIET_XMLTO )$( RM ) $@ && \
168
194
xmlto -m $(MANPAGE_XSL ) man $<
169
195
170
196
% .xml : % .txt
171
- $(RM ) $@ + $@
197
+ $(QUIET_ASCIIDOC )$( RM ) $@ + $@ && \
172
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 $@ + $< && \
174
200
mv $@ + $@
175
201
176
202
user-manual.xml : user-manual.txt user-manual.conf
177
- $(ASCIIDOC ) -b docbook -d book $<
203
+ $(QUIET_ASCIIDOC )$( ASCIIDOC ) -b docbook -d book $<
178
204
179
205
technical/api-index.txt : technical/api-index-skel.txt \
180
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
182
208
183
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 \
185
211
$(ASCIIDOC_EXTRA ) -agit_version=$(GIT_VERSION ) $* .txt
186
212
187
213
XSLT = docbook.xsl
188
214
XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css
189
215
190
216
user-manual.html : user-manual.xml
191
- xsltproc $(XSLTOPTS ) -o $@ $(XSLT ) $<
217
+ $( QUIET_XSLTPROC ) xsltproc $(XSLTOPTS ) -o $@ $(XSLT ) $<
192
218
193
219
git.info : user-manual.texi
194
- $(MAKEINFO ) --no-split -o $@ user-manual.texi
220
+ $(QUIET_MAKEINFO )$( MAKEINFO ) --no-split -o $@ user-manual.texi
195
221
196
222
user-manual.texi : user-manual.xml
197
- $(RM ) $@ + $@
223
+ $(QUIET_DB2TEXI )$( RM ) $@ + $@ && \
198
224
$(DOCBOOK2X_TEXI ) user-manual.xml --encoding=UTF-8 --to-stdout | \
199
- $(PERL_PATH ) fix-texi.perl > $@ +
225
+ $(PERL_PATH ) fix-texi.perl > $@ + && \
200
226
mv $@ + $@
201
227
202
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 $< && \
205
231
mv $@ + $@
206
232
207
233
gitman.texi : $(MAN_XML ) cat-texi.perl
208
- $(RM ) $@ + $@
234
+ $(QUIET_DB2TEXI )$( RM ) $@ + $@ && \
209
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 $@ > $@ + && \
211
237
mv $@ + $@
212
238
213
239
gitman.info : gitman.texi
214
- $(MAKEINFO ) --no-split --no-validate $* .texi
240
+ $(QUIET_MAKEINFO )$( MAKEINFO ) --no-split --no-validate $* .texi
215
241
216
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 > $@ + && \
219
245
mv $@ + $@
220
246
221
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) > $@ + && \
224
250
mv $@ + $@
225
251
226
252
$(patsubst % ,% .html,$(ARTICLES ) ) : % .html : % .txt
227
- $(ASCIIDOC ) -b xhtml11 $* .txt
253
+ $(QUIET_ASCIIDOC )$( ASCIIDOC ) -b xhtml11 $* .txt
228
254
229
255
WEBDOC_DEST = /pub/software/scm/git/docs
230
256
231
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 - > $@ + && \
234
260
mv $@ + $@
235
261
236
262
install-webdoc : html
0 commit comments