summaryrefslogtreecommitdiff
path: root/Documentation/media/Makefile
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-11-14 14:32:32 -0200
committerJonathan Corbet <corbet@lwn.net>2016-11-16 15:20:59 -0700
commit15a04d4e76bd7ba755591f2369c574d8a0a7dc5d (patch)
tree9d4e655552bafc4e520a98c602f68ae6dea0c7a3 /Documentation/media/Makefile
parentf3902934797b0b00ba8f10bfc377c1bb2789046c (diff)
downloadlwn-15a04d4e76bd7ba755591f2369c574d8a0a7dc5d.tar.gz
lwn-15a04d4e76bd7ba755591f2369c574d8a0a7dc5d.zip
docs-rst: auto-generate PDF image files
The PDF files that contain media images were actually generated offline from their SVG or PNG source files. Sphinx can handle PNG sources automatially. So, let's just drop their PDF counterparts. For SVG, however, Sphinx doesn't produce the right tags to use the TexLive SVG support. Also, the SVG support is done via shell execution, with is not nice. So, while we don't have any support for SVG inside Sphinx core or as an extension, move the logic to build them to Makefile, producing the PDF images on runtime. NOTE: due to the way Sphinx works, the PDF images should be generated inside the Kernel source tree, as otherwise Sphinx won't find it, not obeying what's specified by "O=" makefile parameter. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'Documentation/media/Makefile')
-rw-r--r--Documentation/media/Makefile29
1 files changed, 28 insertions, 1 deletions
diff --git a/Documentation/media/Makefile b/Documentation/media/Makefile
index a7fb35291f6c..297b85c37ab9 100644
--- a/Documentation/media/Makefile
+++ b/Documentation/media/Makefile
@@ -10,8 +10,35 @@ FILES = audio.h.rst ca.h.rst dmx.h.rst frontend.h.rst net.h.rst video.h.rst \
TARGETS := $(addprefix $(BUILDDIR)/, $(FILES))
-.PHONY: all
+IMAGES = \
+ typical_media_device.svg \
+ uapi/dvb/dvbstb.svg \
+ uapi/v4l/constraints.svg \
+ uapi/v4l/subdev-image-processing-full.svg \
+ uapi/v4l/subdev-image-processing-scaling-multi-source.svg \
+ uapi/v4l/subdev-image-processing-crop.svg \
+
+IMGTGT := $(patsubst %.png,%.pdf,$(patsubst %.svg,%.pdf,$(IMAGES)))
+IMGPDF := $(patsubst %,$(SRC_DIR)/%,$(IMGTGT))
+
+cmd = $(echo-cmd) $(cmd_$(1))
+
+quiet_cmd_genpdf = GENPDF $2
+ cmd_genpdf = convert $2 $3
+
+%.pdf: %.svg
+ @$(call cmd,genpdf,$<,$@)
+
+.PHONY: all html epub xml latex
+
all: $(BUILDDIR) ${TARGETS}
+html: all
+epub: all
+xml: all
+latex: $(IMGPDF) all
+
+clean:
+ -rm $(IMGTGT) 2>/dev/null
$(BUILDDIR):
$(Q)mkdir -p $@