{"thread":{"id":"18585","subject":"[PATCH v2 1/2] Documentation/Makefile: make most operations \"quiet\"","startedAt":"2009-03-27T06:49:38Z","lastAt":"2009-03-29T11:52:52Z","messageCount":3,"participants":["Chris Johnsen","Jeff King"],"isPatch":true,"patchVersion":2,"patchTotal":2},"messages":[{"id":"109614","messageId":"1238136579-23166-1-git-send-email-chris_johnsen@pobox.com","threadId":"18585","inReplyTo":null,"subject":"[PATCH v2 1/2] Documentation/Makefile: make most operations \"quiet\"","fromName":"Chris Johnsen","fromEmail":"chris_johnsen@pobox.com","sentAt":"2009-03-27T06:49:38Z","receivedAt":"2009-03-27T06:49:38Z","isPatch":true,"sender":{"key":"chris_johnsen@pobox.com","avatar":"https://avatars.githubusercontent.com/u/107071?v=4"},"body":"This adapts the \"quiet make\" implementation from the main\nMakefile.\n\nSigned-off-by: Chris Johnsen <chris_johnsen@pobox.com>\n\n---\n\n\"v1\" of this series can be found here: <http://thread.gmane.org/gmane.comp.version-control.git/114417/focus=114557>.\n\nChanges since \"v1\": Fixed broken technical/api-index.txt target\n  (thanks, Peff). Extended error propagation across calls to\n  DOCBOOK2X_TEXI for gitman.texi. Added QUIET_XSLTPROC for\n  \"one-off\" user-manual.html.\n---\n Documentation/Makefile |   84 +++++++++++++++++++++++++++++++----------------\n 1 files changed, 55 insertions(+), 29 deletions(-)\n\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex 144ec32..3e1d175 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -76,6 +76,32 @@ endif\n # yourself - yes, all 6 characters of it!\n #\n \n+QUIET_SUBDIR0  = +$(MAKE) -C # space to separate -C and subdir\n+QUIET_SUBDIR1  =\n+\n+ifneq ($(findstring $(MAKEFLAGS),w),w)\n+PRINT_DIR = --no-print-directory\n+else # \"make -w\"\n+NO_SUBDIR = :\n+endif\n+\n+ifneq ($(findstring $(MAKEFLAGS),s),s)\n+ifndef V\n+\tQUIET_ASCIIDOC\t= @echo '   ' ASCIIDOC $@;\n+\tQUIET_XMLTO\t= @echo '   ' XMLTO $@;\n+\tQUIET_DB2TEXI\t= @echo '   ' DB2TEXI $@;\n+\tQUIET_MAKEINFO\t= @echo '   ' MAKEINFO $@;\n+\tQUIET_DBLATEX\t= @echo '   ' DBLATEX $@;\n+\tQUIET_XSLTPROC\t= @echo '   ' XSLTPROC $@;\n+\tQUIET_GEN\t= @echo '   ' GEN $@;\n+\tQUIET_STDERR\t= 2> /dev/null\n+\tQUIET_SUBDIR0\t= +@subdir=\n+\tQUIET_SUBDIR1\t= ;$(NO_SUBDIR) echo '   ' SUBDIR $$subdir; \\\n+\t\t\t  $(MAKE) $(PRINT_DIR) -C $$subdir\n+\texport V\n+endif\n+endif\n+\n all: html man\n \n html: $(DOC_HTML)\n@@ -119,7 +145,7 @@ install-html: html\n \tsh ./install-webdoc.sh $(DESTDIR)$(htmldir)\n \n ../GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE\n-\t$(MAKE) -C ../ GIT-VERSION-FILE\n+\t$(QUIET_SUBDIR0)../ $(QUIET_SUBDIR1) GIT-VERSION-FILE\n \n -include ../GIT-VERSION-FILE\n \n@@ -127,8 +153,8 @@ install-html: html\n # Determine \"include::\" file references in asciidoc files.\n #\n doc.dep : $(wildcard *.txt) build-docdep.perl\n-\t$(RM) $@+ $@\n-\t$(PERL_PATH) ./build-docdep.perl >$@+\n+\t$(QUIET_GEN)$(RM) $@+ $@ && \\\n+\t$(PERL_PATH) ./build-docdep.perl >$@+ $(QUIET_STDERR) && \\\n \tmv $@+ $@\n \n -include doc.dep\n@@ -146,8 +172,8 @@ cmds_txt = cmds-ancillaryinterrogators.txt \\\n $(cmds_txt): cmd-list.made\n \n cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT)\n-\t$(RM) $@\n-\t$(PERL_PATH) ./cmd-list.perl ../command-list.txt\n+\t$(QUIET_GEN)$(RM) $@ && \\\n+\t$(PERL_PATH) ./cmd-list.perl ../command-list.txt $(QUIET_STDERR) && \\\n \tdate >$@\n \n clean:\n@@ -158,79 +184,79 @@ clean:\n \t$(RM) $(cmds_txt) *.made\n \n $(MAN_HTML): %.html : %.txt\n-\t$(RM) $@+ $@\n+\t$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \\\n \t$(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \\\n-\t\t$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $<\n+\t\t$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< && \\\n \tmv $@+ $@\n \n %.1 %.5 %.7 : %.xml\n-\t$(RM) $@\n+\t$(QUIET_XMLTO)$(RM) $@ && \\\n \txmlto -m $(MANPAGE_XSL) man $<\n \n %.xml : %.txt\n-\t$(RM) $@+ $@\n+\t$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \\\n \t$(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \\\n-\t\t$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $<\n+\t\t$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< && \\\n \tmv $@+ $@\n \n user-manual.xml: user-manual.txt user-manual.conf\n-\t$(ASCIIDOC) -b docbook -d book $<\n+\t$(QUIET_ASCIIDOC)$(ASCIIDOC) -b docbook -d book $<\n \n technical/api-index.txt: technical/api-index-skel.txt \\\n \ttechnical/api-index.sh $(patsubst %,%.txt,$(API_DOCS))\n-\tcd technical && sh ./api-index.sh\n+\t$(QUIET_GEN)cd technical && sh ./api-index.sh\n \n $(patsubst %,%.html,$(API_DOCS) technical/api-index): %.html : %.txt\n-\t$(ASCIIDOC) -b xhtml11 -f asciidoc.conf \\\n+\t$(QUIET_ASCIIDOC)$(ASCIIDOC) -b xhtml11 -f asciidoc.conf \\\n \t\t$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) $*.txt\n \n XSLT = docbook.xsl\n XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css\n \n user-manual.html: user-manual.xml\n-\txsltproc $(XSLTOPTS) -o $@ $(XSLT) $<\n+\t$(QUIET_XSLTPROC)xsltproc $(XSLTOPTS) -o $@ $(XSLT) $<\n \n git.info: user-manual.texi\n-\t$(MAKEINFO) --no-split -o $@ user-manual.texi\n+\t$(QUIET_MAKEINFO)$(MAKEINFO) --no-split -o $@ user-manual.texi\n \n user-manual.texi: user-manual.xml\n-\t$(RM) $@+ $@\n+\t$(QUIET_DB2TEXI)$(RM) $@+ $@ && \\\n \t$(DOCBOOK2X_TEXI) user-manual.xml --encoding=UTF-8 --to-stdout | \\\n-\t\t$(PERL_PATH) fix-texi.perl >$@+\n+\t\t$(PERL_PATH) fix-texi.perl >$@+ && \\\n \tmv $@+ $@\n \n user-manual.pdf: user-manual.xml\n-\t$(RM) $@+ $@\n-\t$(DBLATEX) -o $@+ -p /etc/asciidoc/dblatex/asciidoc-dblatex.xsl -s /etc/asciidoc/dblatex/asciidoc-dblatex.sty $<\n+\t$(QUIET_DBLATEX)$(RM) $@+ $@ && \\\n+\t$(DBLATEX) -o $@+ -p /etc/asciidoc/dblatex/asciidoc-dblatex.xsl -s /etc/asciidoc/dblatex/asciidoc-dblatex.sty $< && \\\n \tmv $@+ $@\n \n gitman.texi: $(MAN_XML) cat-texi.perl\n-\t$(RM) $@+ $@\n+\t$(QUIET_DB2TEXI)$(RM) $@+ $@ && \\\n \t($(foreach xml,$(MAN_XML),$(DOCBOOK2X_TEXI) --encoding=UTF-8 \\\n-\t\t--to-stdout $(xml);)) | $(PERL_PATH) cat-texi.perl $@ >$@+\n+\t\t--to-stdout $(xml) &&) true) | $(PERL_PATH) cat-texi.perl $@ >$@+ && \\\n \tmv $@+ $@\n \n gitman.info: gitman.texi\n-\t$(MAKEINFO) --no-split --no-validate $*.texi\n+\t$(QUIET_MAKEINFO)$(MAKEINFO) --no-split --no-validate $*.texi\n \n $(patsubst %.txt,%.texi,$(MAN_TXT)): %.texi : %.xml\n-\t$(RM) $@+ $@\n-\t$(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@+\n+\t$(QUIET_DB2TEXI)$(RM) $@+ $@ && \\\n+\t$(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@+ && \\\n \tmv $@+ $@\n \n howto-index.txt: howto-index.sh $(wildcard howto/*.txt)\n-\t$(RM) $@+ $@\n-\tsh ./howto-index.sh $(wildcard howto/*.txt) >$@+\n+\t$(QUIET_GEN)$(RM) $@+ $@ && \\\n+\tsh ./howto-index.sh $(wildcard howto/*.txt) >$@+ && \\\n \tmv $@+ $@\n \n $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt\n-\t$(ASCIIDOC) -b xhtml11 $*.txt\n+\t$(QUIET_ASCIIDOC)$(ASCIIDOC) -b xhtml11 $*.txt\n \n WEBDOC_DEST = /pub/software/scm/git/docs\n \n $(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt\n-\t$(RM) $@+ $@\n-\tsed -e '1,/^$$/d' $< | $(ASCIIDOC) -b xhtml11 - >$@+\n+\t$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \\\n+\tsed -e '1,/^$$/d' $< | $(ASCIIDOC) -b xhtml11 - >$@+ && \\\n \tmv $@+ $@\n \n install-webdoc : html\n-- \n1.6.2.1.401.gc048\n"},{"id":"109615","messageId":"1238136579-23166-2-git-send-email-chris_johnsen@pobox.com","threadId":"18585","inReplyTo":"1238136579-23166-1-git-send-email-chris_johnsen@pobox.com","subject":"[PATCH v2 2/2] Documentation/Makefile: break up texi pipeline","fromName":"Chris Johnsen","fromEmail":"chris_johnsen@pobox.com","sentAt":"2009-03-27T06:49:39Z","receivedAt":"2009-03-27T06:49:39Z","isPatch":true,"sender":{"key":"chris_johnsen@pobox.com","avatar":"https://avatars.githubusercontent.com/u/107071?v=4"},"body":"Most shells define the exit value of a pipeline as the exit value\nof the last process. For each texi rule, run the DOCBOOK2X_TEXI\ntool and the \"fixup\" script in their own non-pipeline commands so\nthat make will notice an error exit code.\n\nSigned-off-by: Chris Johnsen <chris_johnsen@pobox.com>\n\n---\n\nChange since \"v1\": Fix incompletely introduced, \"&& chain\" in\n  gitman.texi rule.\n\nThis textually depends on my \"quiet doc gen\" patch as it modifies\na couple of the same lines.\n---\n Documentation/Makefile |   11 +++++++----\n 1 files changed, 7 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex 3e1d175..d145372 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -178,7 +178,7 @@ cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT)\n \n clean:\n \t$(RM) *.xml *.xml+ *.html *.html+ *.1 *.5 *.7\n-\t$(RM) *.texi *.texi+ git.info gitman.info\n+\t$(RM) *.texi *.texi+ *.texi++ git.info gitman.info\n \t$(RM) howto-index.txt howto/*.html doc.dep\n \t$(RM) technical/api-*.html technical/api-index.txt\n \t$(RM) $(cmds_txt) *.made\n@@ -221,8 +221,9 @@ git.info: user-manual.texi\n \n user-manual.texi: user-manual.xml\n \t$(QUIET_DB2TEXI)$(RM) $@+ $@ && \\\n-\t$(DOCBOOK2X_TEXI) user-manual.xml --encoding=UTF-8 --to-stdout | \\\n-\t\t$(PERL_PATH) fix-texi.perl >$@+ && \\\n+\t$(DOCBOOK2X_TEXI) user-manual.xml --encoding=UTF-8 --to-stdout >$@++ && \\\n+\t$(PERL_PATH) fix-texi.perl <$@++ >$@+ && \\\n+\trm $@++ && \\\n \tmv $@+ $@\n \n user-manual.pdf: user-manual.xml\n@@ -233,7 +234,9 @@ user-manual.pdf: user-manual.xml\n gitman.texi: $(MAN_XML) cat-texi.perl\n \t$(QUIET_DB2TEXI)$(RM) $@+ $@ && \\\n \t($(foreach xml,$(MAN_XML),$(DOCBOOK2X_TEXI) --encoding=UTF-8 \\\n-\t\t--to-stdout $(xml) &&) true) | $(PERL_PATH) cat-texi.perl $@ >$@+ && \\\n+\t\t--to-stdout $(xml) &&) true) > $@++ && \\\n+\t$(PERL_PATH) cat-texi.perl $@ <$@++ >$@+ && \\\n+\trm $@++ && \\\n \tmv $@+ $@\n \n gitman.info: gitman.texi\n-- \n1.6.2.1.401.gc048\n"},{"id":"109770","messageId":"20090329115252.GB31649@coredump.intra.peff.net","threadId":"18585","inReplyTo":"1238136579-23166-1-git-send-email-chris_johnsen@pobox.com","subject":"Re: [PATCH v2 1/2] Documentation/Makefile: make most operations \"quiet\"","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-03-29T11:52:52Z","receivedAt":"2009-03-29T11:52:52Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Mar 27, 2009 at 01:49:38AM -0500, Chris Johnsen wrote:\n\n> \"v1\" of this series can be found here: <http://thread.gmane.org/gmane.comp.version-control.git/114417/focus=114557>.\n> \n> Changes since \"v1\": Fixed broken technical/api-index.txt target\n>   (thanks, Peff). Extended error propagation across calls to\n>   DOCBOOK2X_TEXI for gitman.texi. Added QUIET_XSLTPROC for\n>   \"one-off\" user-manual.html.\n\nThis version looks fine to me (though I admit I didn't look at the texi,\nsince I don't have that toolchain installed).\n\nThanks for detailing in both series what changed from v1; that makes it\nmuch simpler to review.\n\n-Peff\n"}]}