List for cgit developers and users
 help / color / mirror / Atom feed
From: tmz at pobox.com (Todd Zullinger)
Subject: [RFC PATCH] Makefile: work around parallel make issues in docs
Date: Sat, 16 Jun 2018 12:40:21 -0400	[thread overview]
Message-ID: <20180616164021.GF11827@zaya.teonanacatl.net> (raw)
In-Reply-To: <20180616085549.1a746867@andromeda.fritz.box>

Thomas Moschny wrote:
> Todd Zullinger <tmz at pobox.com>:
> 
>> 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



  reply	other threads:[~2018-06-16 16:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-16  5:38 tmz
2018-06-16  6:55 ` thomas.moschny
2018-06-16 16:40   ` tmz [this message]
2018-06-16 12:20 ` john
2018-06-16 12:50   ` Jason
2018-06-16 16:32   ` tmz
2018-06-16 17:18     ` john
2018-06-16 17:52       ` tmz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180616164021.GF11827@zaya.teonanacatl.net \
    --to=cgit@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).