From mboxrd@z Thu Jan 1 00:00:00 1970 From: thomas.moschny at gmx.de (Thomas Moschny) Date: Sat, 16 Jun 2018 08:55:49 +0200 Subject: [RFC PATCH] Makefile: work around parallel make issues in docs In-Reply-To: <20180616053831.26936-1-tmz@pobox.com> References: <20180616053831.26936-1-tmz@pobox.com> Message-ID: <20180616085549.1a746867@andromeda.fritz.box> Todd Zullinger : > When make is run with multiple jobs, doc-man and doc-html fail. The > a2x command tries to write %.5.xml for each invocation, overwriting > each other. > > Work around this by copying %.5 to %.5+ in doc-man. This is a rather > gross hack, but nothing better came to mind. Using --asciidoc-opts to > pass the '--out-file' did not affect the temporary .xml file at issue. What about using a --destination-dir (-D) to a2x? It puts the temporary .xml also into that dir. Something like this: diff --git a/Makefile b/Makefile index 687069f..2ccee34 100644 --- a/Makefile +++ b/Makefile @@ -131,7 +131,10 @@ doc-html: $(DOC_HTML) doc-pdf: $(DOC_PDF) %.5 : %.5.txt - a2x -f manpage $< + mkdir $@.dir + a2x -f manpage -D $@.dir $< + mv $@.dir/$@ . + rmdir $@.dir $(DOC_HTML): %.html : %.txt a2x -f xhtml --stylesheet=cgit-doc.css --xsltproc-opts="--param generate.consistent.ids 1" $< One might want to additionally clean up the directory somewhere (as it is not removed in case something goes wrong with the a2x call). - Thomas