Skip to content

Commit

Permalink
docs-rst: media: build SVG from graphviz files
Browse files Browse the repository at this point in the history
Instead of keeping both SVG and graphviz files, dynamically
build SVG from its graphviz sources.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
  • Loading branch information
Mauro Carvalho Chehab authored and Jonathan Corbet committed Dec 1, 2016
1 parent ffbdad9 commit ec868e4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 74 deletions.
2 changes: 2 additions & 0 deletions Documentation/media/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
*.pdf
# Files generated from *.dot
uapi/v4l/pipeline.svg
20 changes: 14 additions & 6 deletions Documentation/media/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ FILES = audio.h.rst ca.h.rst dmx.h.rst frontend.h.rst net.h.rst video.h.rst \

TARGETS := $(addprefix $(BUILDDIR)/, $(FILES))

DOTS = \
uapi/v4l/pipeline.dot \

IMAGES = \
typical_media_device.svg \
uapi/dvb/dvbstb.svg \
Expand All @@ -29,28 +32,36 @@ IMAGES = \
uapi/v4l/vbi_625.svg \
uapi/v4l/vbi_hsync.svg \

DOTTGT := $(patsubst %.dot,%.svg,$(DOTS))
IMGDOT := $(patsubst %,$(SRC_DIR)/%,$(DOTTGT))

IMGTGT := $(patsubst %.png,%.pdf,$(patsubst %.svg,%.pdf,$(IMAGES)))
IMGTGT := $(patsubst %.svg,%.pdf,$(IMAGES))
IMGPDF := $(patsubst %,$(SRC_DIR)/%,$(IMGTGT))

cmd = $(echo-cmd) $(cmd_$(1))

quiet_cmd_genpdf = GENPDF $2
cmd_genpdf = convert $2 $3

quiet_cmd_gendot = DOT $2
cmd_gendot = dot -Tsvg $2 > $3

%.pdf: %.svg
@$(call cmd,genpdf,$<,$@)

%.svg: %.dot
@$(call cmd,gendot,$<,$@)

.PHONY: all html epub xml latex

all: $(BUILDDIR) ${TARGETS}
all: $(IMGDOT) $(BUILDDIR) ${TARGETS}
html: all
epub: all
xml: all
latex: $(IMGPDF) all

clean:
-rm -f $(IMGTGT) 2>/dev/null
-rm -f $(DOTTGT) $(IMGTGT) $(patsubst %,$(SRC_DIR)/%,${TARGETS}) 2>/dev/null

$(BUILDDIR):
$(Q)mkdir -p $@
Expand Down Expand Up @@ -95,6 +106,3 @@ $(BUILDDIR)/cec.h.rst: ${KAPI}/cec.h ${PARSER} $(SRC_DIR)/cec.h.rst.exceptions

$(BUILDDIR)/lirc.h.rst: ${UAPI}/lirc.h ${PARSER} $(SRC_DIR)/lirc.h.rst.exceptions
@$($(quiet)gen_rst)

cleandocs:
-rm -f ${TARGETS}
68 changes: 0 additions & 68 deletions Documentation/media/uapi/v4l/pipeline.svg

This file was deleted.

0 comments on commit ec868e4

Please sign in to comment.