diff mbox series

[8/8] doc: join xml and man rules

Message ID 20210512222803.508446-9-felipe.contreras@gmail.com (mailing list archive)
State Superseded
Headers show
Series doc: asciidoc cleanups | expand

Commit Message

Felipe Contreras May 12, 2021, 10:28 p.m. UTC
Will be useful later with asciidoctor that can do both at the same time.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 Documentation/Makefile | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Martin Ågren May 13, 2021, 11:02 a.m. UTC | #1
On Thu, 13 May 2021 at 00:28, Felipe Contreras
<felipe.contreras@gmail.com> wrote:
>
> Will be useful later with asciidoctor that can do both at the same time.

> -%.1 %.5 %.7 : %.xml manpage-base-url.xsl $(wildcard manpage*.xsl)
> -       $(QUIET_XMLTO)$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
> -
> -%.xml : %.txt $(ASCIIDOC_DEPS)
> -       $(QUIET_ASCIIDOC)$(TXT_TO_XML) -d manpage -o $@ $<
> +%.1 %.5 %.7 : %.txt $(ASCIIDOC_DEPS) manpage-base-url.xsl $(wildcard manpage*.xsl)
> +       $(QUIET_ASCIIDOC)$(TXT_TO_XML) -d manpage -o $*.xml $< && \
> +       $(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $*.xml

It does mean that if manpage-base-url.xsl changes, we'll regenerate all
the xml files. Before this change, we would just rerun the xmlto step.

Also, this will break `make info`. It will either find xml files that
"happen" to be there, e.g., because you just built the manpages (or
maybe you did so several weeks ago), or it won't find them and error
out.

(If you're wondering if anyone is actually using `make info`, there's
some discussion at [1]. I don't think anyone would be too sad to see it
go. Once `make info` is the only reason we need to generate the xml
files, I think it's a given we should try to drop that stuff.)

I think we should keep the separate xml targets as long as "asciidoctor
without xmlto" isn't the only way we support building the manpages. If
the only benefit here is "later", I think we should do this patch later.
I could also imagine that the xml target will just go away once all the
"old" ways of building the manpages are gone and `make info` is gone,
i.e., when we simply don't need any of these generated xml files.

[1] https://lore.kernel.org/git/20200402004533.GA6369@camp.crustytoothpaste.net/

Martin
Felipe Contreras May 13, 2021, 11:15 a.m. UTC | #2
Martin Ågren wrote:
> On Thu, 13 May 2021 at 00:28, Felipe Contreras
> <felipe.contreras@gmail.com> wrote:
> >
> > Will be useful later with asciidoctor that can do both at the same time.
> 
> > -%.1 %.5 %.7 : %.xml manpage-base-url.xsl $(wildcard manpage*.xsl)
> > -       $(QUIET_XMLTO)$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
> > -
> > -%.xml : %.txt $(ASCIIDOC_DEPS)
> > -       $(QUIET_ASCIIDOC)$(TXT_TO_XML) -d manpage -o $@ $<
> > +%.1 %.5 %.7 : %.txt $(ASCIIDOC_DEPS) manpage-base-url.xsl $(wildcard manpage*.xsl)
> > +       $(QUIET_ASCIIDOC)$(TXT_TO_XML) -d manpage -o $*.xml $< && \
> > +       $(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $*.xml
> 
> It does mean that if manpage-base-url.xsl changes, we'll regenerate all
> the xml files. Before this change, we would just rerun the xmlto step.

True.

> Also, this will break `make info`.

Ahh, I didn't see that dependency on MAN_XML.

> (If you're wondering if anyone is actually using `make info`, there's
> some discussion at [1]. I don't think anyone would be too sad to see it
> go. Once `make info` is the only reason we need to generate the xml
> files, I think it's a given we should try to drop that stuff.)

Perhaps, but not in this patch series.

> I think we should keep the separate xml targets as long as "asciidoctor
> without xmlto" isn't the only way we support building the manpages. If
> the only benefit here is "later", I think we should do this patch later.
> I could also imagine that the xml target will just go away once all the
> "old" ways of building the manpages are gone and `make info` is gone,
> i.e., when we simply don't need any of these generated xml files.

Agreed. I will drop this in the next version.

Cheers.
diff mbox series

Patch

diff --git a/Documentation/Makefile b/Documentation/Makefile
index ba0c947d0d..d5ea05295d 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -367,11 +367,9 @@  $(OBSOLETE_HTML): %.html : %.txto $(ASCIIDOC_DEPS)
 manpage-base-url.xsl: manpage-base-url.xsl.in
 	$(QUIET_GEN)sed "s|@@MAN_BASE_URL@@|$(MAN_BASE_URL)|" $< > $@
 
-%.1 %.5 %.7 : %.xml manpage-base-url.xsl $(wildcard manpage*.xsl)
-	$(QUIET_XMLTO)$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
-
-%.xml : %.txt $(ASCIIDOC_DEPS)
-	$(QUIET_ASCIIDOC)$(TXT_TO_XML) -d manpage -o $@ $<
+%.1 %.5 %.7 : %.txt $(ASCIIDOC_DEPS) manpage-base-url.xsl $(wildcard manpage*.xsl)
+	$(QUIET_ASCIIDOC)$(TXT_TO_XML) -d manpage -o $*.xml $< && \
+	$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $*.xml
 
 user-manual.xml: user-manual.txt user-manual.conf asciidoctor-extensions.rb GIT-ASCIIDOCFLAGS
 	$(QUIET_ASCIIDOC)$(TXT_TO_XML) -d book -o $@ $<