From mboxrd@z Thu Jan 1 00:00:00 1970 From: tmz at pobox.com (Todd Zullinger) Date: Sat, 16 Jun 2018 12:40:21 -0400 Subject: [RFC PATCH] Makefile: work around parallel make issues in docs In-Reply-To: <20180616085549.1a746867@andromeda.fritz.box> References: <20180616053831.26936-1-tmz@pobox.com> <20180616085549.1a746867@andromeda.fritz.box> Message-ID: <20180616164021.GF11827@zaya.teonanacatl.net> Thomas Moschny wrote: > 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). Yeah, that's a nice solution too. Thanks! It's really a2x's fault for stripping the extension and replacing it with .xml rather than just appending .xml to the target name. (But perhaps someone on Windows doesn't want to see a temp file named .html.xml or something.) -- Todd ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A cynic is a man who, when he smells flowers, looks around for a coffin. -- H. L. Mencken