[PATCH spice-common 2/3] build-sys: improve asciidoc rules to allow multiple targets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>

Signed-off-by: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>
---
 docs/Makefile.am | 22 +++++++++++++++-------
 docs/meson.build | 12 +++++++-----
 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
-- 
2.20.1.98.gecbdaf0899

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]