@@ -287,9 +287,9 @@ docdep_prereqs = \
287287 cmd-list.made $(cmds_txt )
288288
289289doc.dep : $(docdep_prereqs ) $(wildcard * .txt) $(wildcard config/* .txt) build-docdep.perl
290- $(QUIET_GEN )$(RM ) $@ + $@ && \
291- $(PERL_PATH ) ./build-docdep.perl > $@ + $(QUIET_STDERR ) && \
292- mv $@ + $@
290+ $(QUIET_GEN )$(RM ) $@ .new $@ && \
291+ $(PERL_PATH ) ./build-docdep.perl > $@ .new $(QUIET_STDERR ) && \
292+ mv $@ .new $@
293293
294294-include doc.dep
295295
@@ -325,8 +325,8 @@ mergetools-list.made: ../git-mergetool--lib.sh $(wildcard ../mergetools/*)
325325 date > $@
326326
327327clean :
328- $(RM ) * .xml * .xml+ * .html * .html+ * .1 * .5 * .7
329- $(RM ) * .texi * .texi+ * .texi++ git.info gitman.info
328+ $(RM ) * .xml * .xml.new * .html * .html.new * .1 * .5 * .7
329+ $(RM ) * .texi * .texi.new * .texi.new.new git.info gitman.info
330330 $(RM ) * .pdf
331331 $(RM ) howto-index.txt howto/* .html doc.dep
332332 $(RM ) technical/* .html technical/api-index.txt
@@ -335,14 +335,14 @@ clean:
335335 $(RM ) manpage-base-url.xsl
336336
337337$(MAN_HTML ) : % .html : % .txt asciidoc.conf
338- $(QUIET_ASCIIDOC )$(RM ) $@ + $@ && \
339- $(TXT_TO_HTML ) -d manpage -o $@ + $< && \
340- mv $@ + $@
338+ $(QUIET_ASCIIDOC )$(RM ) $@ .new $@ && \
339+ $(TXT_TO_HTML ) -d manpage -o $@ .new $< && \
340+ mv $@ .new $@
341341
342342$(OBSOLETE_HTML ) : % .html : % .txto asciidoc.conf
343- $(QUIET_ASCIIDOC )$(RM ) $@ + $@ && \
344- $(TXT_TO_HTML ) -o $@ + $< && \
345- mv $@ + $@
343+ $(QUIET_ASCIIDOC )$(RM ) $@ .new $@ && \
344+ $(TXT_TO_HTML ) -o $@ .new $< && \
345+ mv $@ .new $@
346346
347347manpage-base-url.xsl : manpage-base-url.xsl.in
348348 $(QUIET_GEN ) sed " s|@@MAN_BASE_URL@@|$( MAN_BASE_URL) |" $< > $@
@@ -352,14 +352,14 @@ manpage-base-url.xsl: manpage-base-url.xsl.in
352352 $(XMLTO ) -m $(MANPAGE_XSL ) $(XMLTO_EXTRA ) man $<
353353
354354% .xml : % .txt asciidoc.conf
355- $(QUIET_ASCIIDOC )$(RM ) $@ + $@ && \
356- $(TXT_TO_XML ) -d manpage -o $@ + $< && \
357- mv $@ + $@
355+ $(QUIET_ASCIIDOC )$(RM ) $@ .new $@ && \
356+ $(TXT_TO_XML ) -d manpage -o $@ .new $< && \
357+ mv $@ .new $@
358358
359359user-manual.xml : user-manual.txt user-manual.conf
360- $(QUIET_ASCIIDOC )$(RM ) $@ + $@ && \
361- $(TXT_TO_XML ) -d book -o $@ + $< && \
362- mv $@ + $@
360+ $(QUIET_ASCIIDOC )$(RM ) $@ .new $@ && \
361+ $(TXT_TO_XML ) -d book -o $@ .new $< && \
362+ mv $@ .new $@
363363
364364technical/api-index.txt : technical/api-index-skel.txt \
365365 technical/api-index.sh $(patsubst % ,% .txt,$(API_DOCS ) )
@@ -376,46 +376,46 @@ XSLT = docbook.xsl
376376XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css
377377
378378user-manual.html : user-manual.xml $(XSLT )
379- $(QUIET_XSLTPROC )$(RM ) $@ + $@ && \
380- xsltproc $(XSLTOPTS ) -o $@ + $(XSLT ) $< && \
381- mv $@ + $@
379+ $(QUIET_XSLTPROC )$(RM ) $@ .new $@ && \
380+ xsltproc $(XSLTOPTS ) -o $@ .new $(XSLT ) $< && \
381+ mv $@ .new $@
382382
383383git.info : user-manual.texi
384384 $(QUIET_MAKEINFO )$(MAKEINFO ) --no-split -o $@ user-manual.texi
385385
386386user-manual.texi : user-manual.xml
387- $(QUIET_DB2TEXI )$(RM ) $@ + $@ && \
388- $(DOCBOOK2X_TEXI ) user-manual.xml --encoding=UTF-8 --to-stdout > $@ ++ && \
389- $(PERL_PATH ) fix-texi.perl < $@ ++ > $@ + && \
390- rm $@ ++ && \
391- mv $@ + $@
387+ $(QUIET_DB2TEXI )$(RM ) $@ .new $@ && \
388+ $(DOCBOOK2X_TEXI ) user-manual.xml --encoding=UTF-8 --to-stdout > $@ .new.new && \
389+ $(PERL_PATH ) fix-texi.perl < $@ .new.new > $@ .new && \
390+ rm $@ .new.new && \
391+ mv $@ .new $@
392392
393393user-manual.pdf : user-manual.xml
394- $(QUIET_DBLATEX )$(RM ) $@ + $@ && \
395- $(DBLATEX ) -o $@ + $(DBLATEX_COMMON ) $< && \
396- mv $@ + $@
394+ $(QUIET_DBLATEX )$(RM ) $@ .new $@ && \
395+ $(DBLATEX ) -o $@ .new $(DBLATEX_COMMON ) $< && \
396+ mv $@ .new $@
397397
398398gitman.texi : $(MAN_XML ) cat-texi.perl texi.xsl
399- $(QUIET_DB2TEXI )$(RM ) $@ + $@ && \
400- ($( foreach xml,$( sort $( MAN_XML) ) ,xsltproc -o $( xml) + texi.xsl $( xml) && \
401- $(DOCBOOK2X_TEXI ) --encoding=UTF-8 --to-stdout $(xml ) + && \
402- rm $(xml ) + && ) true) > $@ ++ && \
403- $(PERL_PATH ) cat-texi.perl $@ < $@ ++ > $@ + && \
404- rm $@ ++ && \
405- mv $@ + $@
399+ $(QUIET_DB2TEXI )$(RM ) $@ .new $@ && \
400+ ($( foreach xml,$( sort $( MAN_XML) ) ,xsltproc -o $( xml) .new texi.xsl $( xml) && \
401+ $(DOCBOOK2X_TEXI ) --encoding=UTF-8 --to-stdout $(xml ) .new && \
402+ rm $(xml ) .new && ) true) > $@ .new.new && \
403+ $(PERL_PATH ) cat-texi.perl $@ < $@ .new.new > $@ .new && \
404+ rm $@ .new.new && \
405+ mv $@ .new $@
406406
407407gitman.info : gitman.texi
408408 $(QUIET_MAKEINFO )$(MAKEINFO ) --no-split --no-validate $* .texi
409409
410410$(patsubst % .txt,% .texi,$(MAN_TXT ) ) : % .texi : % .xml
411- $(QUIET_DB2TEXI )$(RM ) $@ + $@ && \
412- $(DOCBOOK2X_TEXI ) --to-stdout $* .xml > $@ + && \
413- mv $@ + $@
411+ $(QUIET_DB2TEXI )$(RM ) $@ .new $@ && \
412+ $(DOCBOOK2X_TEXI ) --to-stdout $* .xml > $@ .new && \
413+ mv $@ .new $@
414414
415415howto-index.txt : howto-index.sh $(wildcard howto/* .txt)
416- $(QUIET_GEN )$(RM ) $@ + $@ && \
417- ' $(SHELL_PATH_SQ)' ./howto-index.sh $(sort $(wildcard howto/* .txt) ) > $@ + && \
418- mv $@ + $@
416+ $(QUIET_GEN )$(RM ) $@ .new $@ && \
417+ ' $(SHELL_PATH_SQ)' ./howto-index.sh $(sort $(wildcard howto/* .txt) ) > $@ .new && \
418+ mv $@ .new $@
419419
420420$(patsubst % ,% .html,$(ARTICLES ) ) : % .html : % .txt
421421 $(QUIET_ASCIIDOC )$(TXT_TO_HTML ) $* .txt
@@ -424,10 +424,10 @@ WEBDOC_DEST = /pub/software/scm/git/docs
424424
425425howto/% .html : ASCIIDOC_EXTRA += -a git-relative-html-prefix=../
426426$(patsubst % .txt,% .html,$(wildcard howto/* .txt) ) : % .html : % .txt
427- $(QUIET_ASCIIDOC )$(RM ) $@ + $@ && \
427+ $(QUIET_ASCIIDOC )$(RM ) $@ .new $@ && \
428428 sed -e ' 1,/^$$/d' $< | \
429- $(TXT_TO_HTML ) - > $@ + && \
430- mv $@ + $@
429+ $(TXT_TO_HTML ) - > $@ .new && \
430+ mv $@ .new $@
431431
432432install-webdoc : html
433433 ' $(SHELL_PATH_SQ)' ./install-webdoc.sh $(WEBDOC_DEST )
0 commit comments