@@ -294,9 +294,9 @@ docdep_prereqs = \
294294 cmd-list.made $(cmds_txt )
295295
296296doc.dep : $(docdep_prereqs ) $(wildcard * .txt) $(wildcard config/* .txt) build-docdep.perl
297- $(QUIET_GEN )$(RM ) $@ + $@ && \
298- $(PERL_PATH ) ./build-docdep.perl > $@ + $(QUIET_STDERR ) && \
299- mv $@ + $@
297+ $(QUIET_GEN )$(RM ) $@ .new $@ && \
298+ $(PERL_PATH ) ./build-docdep.perl > $@ .new $(QUIET_STDERR ) && \
299+ mv $@ .new $@
300300
301301-include doc.dep
302302
@@ -332,8 +332,8 @@ mergetools-list.made: ../git-mergetool--lib.sh $(wildcard ../mergetools/*)
332332 date > $@
333333
334334clean :
335- $(RM ) * .xml * .xml+ * .html * .html+ * .1 * .5 * .7
336- $(RM ) * .texi * .texi+ * .texi++ git.info gitman.info
335+ $(RM ) * .xml * .xml.new * .html * .html.new * .1 * .5 * .7
336+ $(RM ) * .texi * .texi.new * .texi.new.new git.info gitman.info
337337 $(RM ) * .pdf
338338 $(RM ) howto-index.txt howto/* .html doc.dep
339339 $(RM ) technical/* .html technical/api-index.txt
@@ -342,14 +342,14 @@ clean:
342342 $(RM ) manpage-base-url.xsl
343343
344344$(MAN_HTML ) : % .html : % .txt asciidoc.conf
345- $(QUIET_ASCIIDOC )$(RM ) $@ + $@ && \
346- $(TXT_TO_HTML ) -d manpage -o $@ + $< && \
347- mv $@ + $@
345+ $(QUIET_ASCIIDOC )$(RM ) $@ .new $@ && \
346+ $(TXT_TO_HTML ) -d manpage -o $@ .new $< && \
347+ mv $@ .new $@
348348
349349$(OBSOLETE_HTML ) : % .html : % .txto asciidoc.conf
350- $(QUIET_ASCIIDOC )$(RM ) $@ + $@ && \
351- $(TXT_TO_HTML ) -o $@ + $< && \
352- mv $@ + $@
350+ $(QUIET_ASCIIDOC )$(RM ) $@ .new $@ && \
351+ $(TXT_TO_HTML ) -o $@ .new $< && \
352+ mv $@ .new $@
353353
354354manpage-base-url.xsl : manpage-base-url.xsl.in
355355 $(QUIET_GEN ) sed " s|@@MAN_BASE_URL@@|$( MAN_BASE_URL) |" $< > $@
@@ -359,14 +359,14 @@ manpage-base-url.xsl: manpage-base-url.xsl.in
359359 $(XMLTO ) -m $(MANPAGE_XSL ) $(XMLTO_EXTRA ) man $<
360360
361361% .xml : % .txt asciidoc.conf
362- $(QUIET_ASCIIDOC )$(RM ) $@ + $@ && \
363- $(TXT_TO_XML ) -d manpage -o $@ + $< && \
364- mv $@ + $@
362+ $(QUIET_ASCIIDOC )$(RM ) $@ .new $@ && \
363+ $(TXT_TO_XML ) -d manpage -o $@ .new $< && \
364+ mv $@ .new $@
365365
366366user-manual.xml : user-manual.txt user-manual.conf
367- $(QUIET_ASCIIDOC )$(RM ) $@ + $@ && \
368- $(TXT_TO_XML ) -d book -o $@ + $< && \
369- mv $@ + $@
367+ $(QUIET_ASCIIDOC )$(RM ) $@ .new $@ && \
368+ $(TXT_TO_XML ) -d book -o $@ .new $< && \
369+ mv $@ .new $@
370370
371371technical/api-index.txt : technical/api-index-skel.txt \
372372 technical/api-index.sh $(patsubst % ,% .txt,$(API_DOCS ) )
@@ -383,46 +383,46 @@ XSLT = docbook.xsl
383383XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css
384384
385385user-manual.html : user-manual.xml $(XSLT )
386- $(QUIET_XSLTPROC )$(RM ) $@ + $@ && \
387- xsltproc $(XSLTOPTS ) -o $@ + $(XSLT ) $< && \
388- mv $@ + $@
386+ $(QUIET_XSLTPROC )$(RM ) $@ .new $@ && \
387+ xsltproc $(XSLTOPTS ) -o $@ .new $(XSLT ) $< && \
388+ mv $@ .new $@
389389
390390git.info : user-manual.texi
391391 $(QUIET_MAKEINFO )$(MAKEINFO ) --no-split -o $@ user-manual.texi
392392
393393user-manual.texi : user-manual.xml
394- $(QUIET_DB2TEXI )$(RM ) $@ + $@ && \
395- $(DOCBOOK2X_TEXI ) user-manual.xml --encoding=UTF-8 --to-stdout > $@ ++ && \
396- $(PERL_PATH ) fix-texi.perl < $@ ++ > $@ + && \
397- rm $@ ++ && \
398- mv $@ + $@
394+ $(QUIET_DB2TEXI )$(RM ) $@ .new $@ && \
395+ $(DOCBOOK2X_TEXI ) user-manual.xml --encoding=UTF-8 --to-stdout > $@ .new.new && \
396+ $(PERL_PATH ) fix-texi.perl < $@ .new.new > $@ .new && \
397+ rm $@ .new.new && \
398+ mv $@ .new $@
399399
400400user-manual.pdf : user-manual.xml
401- $(QUIET_DBLATEX )$(RM ) $@ + $@ && \
402- $(DBLATEX ) -o $@ + $(DBLATEX_COMMON ) $< && \
403- mv $@ + $@
401+ $(QUIET_DBLATEX )$(RM ) $@ .new $@ && \
402+ $(DBLATEX ) -o $@ .new $(DBLATEX_COMMON ) $< && \
403+ mv $@ .new $@
404404
405405gitman.texi : $(MAN_XML ) cat-texi.perl texi.xsl
406- $(QUIET_DB2TEXI )$(RM ) $@ + $@ && \
407- ($( foreach xml,$( sort $( MAN_XML) ) ,xsltproc -o $( xml) + texi.xsl $( xml) && \
408- $(DOCBOOK2X_TEXI ) --encoding=UTF-8 --to-stdout $(xml ) + && \
409- rm $(xml ) + && ) true) > $@ ++ && \
410- $(PERL_PATH ) cat-texi.perl $@ < $@ ++ > $@ + && \
411- rm $@ ++ && \
412- mv $@ + $@
406+ $(QUIET_DB2TEXI )$(RM ) $@ .new $@ && \
407+ ($( foreach xml,$( sort $( MAN_XML) ) ,xsltproc -o $( xml) .new texi.xsl $( xml) && \
408+ $(DOCBOOK2X_TEXI ) --encoding=UTF-8 --to-stdout $(xml ) .new && \
409+ rm $(xml ) .new && ) true) > $@ .new.new && \
410+ $(PERL_PATH ) cat-texi.perl $@ < $@ .new.new > $@ .new && \
411+ rm $@ .new.new && \
412+ mv $@ .new $@
413413
414414gitman.info : gitman.texi
415415 $(QUIET_MAKEINFO )$(MAKEINFO ) --no-split --no-validate $* .texi
416416
417417$(patsubst % .txt,% .texi,$(MAN_TXT ) ) : % .texi : % .xml
418- $(QUIET_DB2TEXI )$(RM ) $@ + $@ && \
419- $(DOCBOOK2X_TEXI ) --to-stdout $* .xml > $@ + && \
420- mv $@ + $@
418+ $(QUIET_DB2TEXI )$(RM ) $@ .new $@ && \
419+ $(DOCBOOK2X_TEXI ) --to-stdout $* .xml > $@ .new && \
420+ mv $@ .new $@
421421
422422howto-index.txt : howto-index.sh $(wildcard howto/* .txt)
423- $(QUIET_GEN )$(RM ) $@ + $@ && \
424- ' $(SHELL_PATH_SQ)' ./howto-index.sh $(sort $(wildcard howto/* .txt) ) > $@ + && \
425- mv $@ + $@
423+ $(QUIET_GEN )$(RM ) $@ .new $@ && \
424+ ' $(SHELL_PATH_SQ)' ./howto-index.sh $(sort $(wildcard howto/* .txt) ) > $@ .new && \
425+ mv $@ .new $@
426426
427427$(patsubst % ,% .html,$(ARTICLES ) ) : % .html : % .txt
428428 $(QUIET_ASCIIDOC )$(TXT_TO_HTML ) $* .txt
@@ -431,10 +431,10 @@ WEBDOC_DEST = /pub/software/scm/git/docs
431431
432432howto/% .html : ASCIIDOC_EXTRA += -a git-relative-html-prefix=../
433433$(patsubst % .txt,% .html,$(wildcard howto/* .txt) ) : % .html : % .txt
434- $(QUIET_ASCIIDOC )$(RM ) $@ + $@ && \
434+ $(QUIET_ASCIIDOC )$(RM ) $@ .new $@ && \
435435 sed -e ' 1,/^$$/d' $< | \
436- $(TXT_TO_HTML ) - > $@ + && \
437- mv $@ + $@
436+ $(TXT_TO_HTML ) - > $@ .new && \
437+ mv $@ .new $@
438438
439439install-webdoc : html
440440 ' $(SHELL_PATH_SQ)' ./install-webdoc.sh $(WEBDOC_DEST )
0 commit comments