summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2019-01-11 22:14:24 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2019-01-15 17:35:58 +0400
commit57f2c61712d575be720d9c3380d2ca2f8ebfb5ee (patch)
tree7450b798c56eb4ddf527b9969d5483c31c1eb063
parent96700c849d06f295fa1815cc467ae8124040b4b7 (diff)
build-sys: improve asciidoc rules to allow multiple targets
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
-rw-r--r--docs/Makefile.am22
-rw-r--r--docs/meson.build12
2 files changed, 22 insertions, 12 deletions
diff --git a/docs/Makefile.am b/docs/Makefile.am
index 421e5f9..e7e126b 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -1,18 +1,26 @@
NULL =
-ASCIIDOC_FLAGS = -a icons -a toc
+CLEANFILES =
+
+ASCIIDOC_FILES = \
+ spice_protocol.txt \
+ $(NULL)
+
+ASCIIDOC_FLAGS = -n -a icons -a toc
EXTRA_DIST = \
+ $(ASCIIDOC_FILES) \
meson.build \
- spice_protocol.txt \
$(NULL)
if BUILD_HTML_MANUAL
-all-local: spice_protocol.html
+ASCIIDOC_HTML = $(ASCIIDOC_FILES:.txt=.html)
-spice_protocol.html: spice_protocol.txt
- $(AM_V_GEN) $(ASCIIDOC) -n $(ASCIIDOC_FLAGS) -o $@ $<
-endif
+CLEANFILES += $(ASCIIDOC_HTML)
-CLEANFILES = spice_protocol.html
+all-local: $(ASCIIDOC_HTML)
+
+.txt.html:
+ $(AM_V_GEN)$(ASCIIDOC) $(ASCIIDOC_FLAGS) -o $@ $<
+endif
-include $(top_srcdir)/git.mk
diff --git a/docs/meson.build b/docs/meson.build
index 5e10d76..8901762 100644
--- a/docs/meson.build
+++ b/docs/meson.build
@@ -1,10 +1,12 @@
if get_option('manual')
asciidoc = find_program('asciidoc', required : false)
if asciidoc.found()
- custom_target('spice_protocol.html',
- input : files('spice_protocol.txt'),
- output : 'spice_protocol.html',
- build_by_default : true,
- command : [asciidoc, '-n', '-a', 'icons', '-a', 'toc', '-o', '@OUTPUT@', '@INPUT@'])
+ foreach f: ['spice_protocol.txt']
+ custom_target('HTML for @0@'.format(f),
+ input : f,
+ output : '@BASENAME@.html',
+ build_by_default : true,
+ command : [asciidoc, '-n', '-a', 'icons', '-a', 'toc', '-o', '@OUTPUT@', '@INPUT@'])
+ endforeach
endif
endif