This patch series is an attempt to cleanup the Makefile of the documentation. Since v2 only certain $(RM) commands are moved from one patch to another. Felipe Contreras (5): doc: refactor common asciidoc dependencies doc: improve asciidoc dependencies doc: remove unnecessary rm instances doc: simplify Makefile using .DELETE_ON_ERROR doc: avoid using rm directly Documentation/Makefile | 77 ++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 48 deletions(-) Range-diff against v2: 1: 55b188c8ad = 1: cbcaefed3e doc: refactor common asciidoc dependencies 2: e69d0a5b89 = 2: 1c8b0b9123 doc: improve asciidoc dependencies 3: 4f18675ce9 < -: ---------- doc: remove unnecessary rm instances -: ---------- > 3: 3da461a55d doc: remove unnecessary rm instances 4: 935675e070 ! 4: a8c4c4ae26 doc: simplify Makefile using .DELETE_ON_ERROR @@ Documentation/Makefile: docdep_prereqs = \ cmd-list.made $(cmds_txt) doc.dep : $(docdep_prereqs) $(DOC_DEP_TXT) build-docdep.perl -- $(QUIET_GEN)$(RM) $@+ $@ && \ -- $(PERL_PATH) ./build-docdep.perl >$@+ $(QUIET_STDERR) && \ +- $(QUIET_GEN)$(PERL_PATH) ./build-docdep.perl >$@+ $(QUIET_STDERR) && \ - mv $@+ $@ + $(QUIET_GEN)$(PERL_PATH) ./build-docdep.perl >$@ $(QUIET_STDERR) @@ Documentation/Makefile: clean: $(RM) GIT-ASCIIDOCFLAGS $(MAN_HTML): %.html : %.txt $(ASCIIDOC_DEPS) -- $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \ -- $(TXT_TO_HTML) -d manpage -o $@+ $< && \ +- $(QUIET_ASCIIDOC)$(TXT_TO_HTML) -d manpage -o $@+ $< && \ - mv $@+ $@ + $(QUIET_ASCIIDOC)$(TXT_TO_HTML) -d manpage -o $@ $< $(OBSOLETE_HTML): %.html : %.txto $(ASCIIDOC_DEPS) -- $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \ -- $(TXT_TO_HTML) -o $@+ $< && \ +- $(QUIET_ASCIIDOC)$(TXT_TO_HTML) -o $@+ $< && \ - mv $@+ $@ + $(QUIET_ASCIIDOC)$(TXT_TO_HTML) -o $@ $< @@ Documentation/Makefile: manpage-base-url.xsl: manpage-base-url.xsl.in $(QUIET_XMLTO)$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $< %.xml : %.txt $(ASCIIDOC_DEPS) -- $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \ -- $(TXT_TO_XML) -d manpage -o $@+ $< && \ +- $(QUIET_ASCIIDOC)$(TXT_TO_XML) -d manpage -o $@+ $< && \ - mv $@+ $@ + $(QUIET_ASCIIDOC)$(TXT_TO_XML) -d manpage -o $@ $< user-manual.xml: user-manual.txt user-manual.conf asciidoctor-extensions.rb GIT-ASCIIDOCFLAGS -- $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \ -- $(TXT_TO_XML) -d book -o $@+ $< && \ +- $(QUIET_ASCIIDOC)$(TXT_TO_XML) -d book -o $@+ $< && \ - mv $@+ $@ + $(QUIET_ASCIIDOC)$(TXT_TO_XML) -d book -o $@ $< @@ Documentation/Makefile: XSLTOPTS += --stringparam html.stylesheet docbook-xsl.cs XSLTOPTS += --param generate.consistent.ids 1 user-manual.html: user-manual.xml $(XSLT) -- $(QUIET_XSLTPROC)$(RM) $@+ $@ && \ -- xsltproc $(XSLTOPTS) -o $@+ $(XSLT) $< && \ +- $(QUIET_XSLTPROC)xsltproc $(XSLTOPTS) -o $@+ $(XSLT) $< && \ - mv $@+ $@ + $(QUIET_XSLTPROC)xsltproc $(XSLTOPTS) -o $@ $(XSLT) $< @@ Documentation/Makefile: XSLTOPTS += --stringparam html.stylesheet docbook-xsl.cs $(QUIET_MAKEINFO)$(MAKEINFO) --no-split -o $@ user-manual.texi user-manual.texi: user-manual.xml -- $(QUIET_DB2TEXI)$(RM) $@+ $@ && \ -- $(DOCBOOK2X_TEXI) user-manual.xml --encoding=UTF-8 --to-stdout >$@++ && \ +- $(QUIET_DB2TEXI)$(DOCBOOK2X_TEXI) user-manual.xml --encoding=UTF-8 --to-stdout >$@++ && \ - $(PERL_PATH) fix-texi.perl <$@++ >$@+ && \ - rm $@++ && \ - mv $@+ $@ @@ Documentation/Makefile: XSLTOPTS += --stringparam html.stylesheet docbook-xsl.cs + rm $@+ user-manual.pdf: user-manual.xml -- $(QUIET_DBLATEX)$(RM) $@+ $@ && \ -- $(DBLATEX) -o $@+ $(DBLATEX_COMMON) $< && \ +- $(QUIET_DBLATEX)$(DBLATEX) -o $@+ $(DBLATEX_COMMON) $< && \ - mv $@+ $@ + $(QUIET_DBLATEX)$(DBLATEX) -o $@ $(DBLATEX_COMMON) $< gitman.texi: $(MAN_XML) cat-texi.perl texi.xsl -- $(QUIET_DB2TEXI)$(RM) $@+ $@ && \ -+ $(QUIET_DB2TEXI) \ + $(QUIET_DB2TEXI) \ ($(foreach xml,$(sort $(MAN_XML)),xsltproc -o $(xml)+ texi.xsl $(xml) && \ $(DOCBOOK2X_TEXI) --encoding=UTF-8 --to-stdout $(xml)+ && \ - rm $(xml)+ &&) true) > $@++ && \ @@ Documentation/Makefile: XSLTOPTS += --stringparam html.stylesheet docbook-xsl.cs $(QUIET_MAKEINFO)$(MAKEINFO) --no-split --no-validate $*.texi $(patsubst %.txt,%.texi,$(MAN_TXT)): %.texi : %.xml -- $(QUIET_DB2TEXI)$(RM) $@+ $@ && \ -- $(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@+ && \ +- $(QUIET_DB2TEXI)$(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@+ && \ - mv $@+ $@ + $(QUIET_DB2TEXI)$(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@ howto-index.txt: howto-index.sh $(HOWTO_TXT) -- $(QUIET_GEN)$(RM) $@+ $@ && \ -- '$(SHELL_PATH_SQ)' ./howto-index.sh $(sort $(HOWTO_TXT)) >$@+ && \ +- $(QUIET_GEN)'$(SHELL_PATH_SQ)' ./howto-index.sh $(sort $(HOWTO_TXT)) >$@+ && \ - mv $@+ $@ + $(QUIET_GEN)'$(SHELL_PATH_SQ)' ./howto-index.sh $(sort $(HOWTO_TXT)) >$@ $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt $(QUIET_ASCIIDOC)$(TXT_TO_HTML) $*.txt -@@ Documentation/Makefile: WEBDOC_DEST = /pub/software/scm/git/docs - - howto/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../ +@@ Documentation/Makefile: howto/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../ $(patsubst %.txt,%.html,$(HOWTO_TXT)): %.html : %.txt GIT-ASCIIDOCFLAGS -- $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \ -+ $(QUIET_ASCIIDOC) \ + $(QUIET_ASCIIDOC) \ sed -e '1,/^$$/d' $< | \ - $(TXT_TO_HTML) - >$@+ && \ - mv $@+ $@ 5: b621f3b8e9 = 5: 2c330987b5 doc: avoid using rm directly -- 2.32.0.rc0