1 # Rules to convert DOT and SVG to Sphinx images
3 SRC_DIR
=$(srctree
)/Documentation
/media
6 uapi
/v4l
/pipeline.dot \
9 typical_media_device.svg \
12 uapi
/v4l
/constraints.svg \
14 uapi
/v4l
/fieldseq_bt.svg \
15 uapi
/v4l
/fieldseq_tb.svg \
17 uapi
/v4l
/nv12mt_example.svg \
18 uapi
/v4l
/pipeline.svg \
19 uapi
/v4l
/selection.svg \
20 uapi
/v4l
/subdev-image-processing-full.svg \
21 uapi
/v4l
/subdev-image-processing-scaling-multi-source.svg \
22 uapi
/v4l
/subdev-image-processing-crop.svg \
23 uapi
/v4l
/vbi_525.svg \
24 uapi
/v4l
/vbi_625.svg \
25 uapi
/v4l
/vbi_hsync.svg \
27 DOTTGT
:= $(patsubst %.dot
,%.svg
,$(DOTS
))
28 IMGDOT
:= $(patsubst %,$(SRC_DIR
)/%,$(DOTTGT
))
30 IMGTGT
:= $(patsubst %.svg
,%.pdf
,$(IMAGES
))
31 IMGPDF
:= $(patsubst %,$(SRC_DIR
)/%,$(IMGTGT
))
33 cmd
= $(echo-cmd
) $(cmd_
$(1))
35 quiet_cmd_genpdf
= GENPDF
$2
36 cmd_genpdf
= convert
$2 $3
38 quiet_cmd_gendot
= DOT
$2
39 cmd_gendot
= dot
-Tsvg
$2 > $3
42 @
$(call cmd
,genpdf
,$<,$@
)
45 @
$(call cmd
,gendot
,$<,$@
)
47 # Rules to convert a .h file to inline RST documentation
49 PARSER
= $(srctree
)/Documentation
/sphinx
/parse-headers.pl
50 UAPI
= $(srctree
)/include/uapi
/linux
51 KAPI
= $(srctree
)/include/linux
53 FILES
= audio.h.rst ca.h.rst dmx.h.rst frontend.h.rst net.h.rst video.h.rst \
54 videodev2.h.rst media.h.rst cec.h.rst lirc.h.rst
56 TARGETS
:= $(addprefix $(BUILDDIR
)/, $(FILES
))
59 echo
${PARSER} $< $@
$(SRC_DIR
)/$(notdir $@
).exceptions
; \
60 ${PARSER} $< $@
$(SRC_DIR
)/$(notdir $@
).exceptions
62 quiet_gen_rst
= echo
' PARSE $(patsubst $(srctree)/%,%,$<)'; \
63 ${PARSER} $< $@
$(SRC_DIR
)/$(notdir $@
).exceptions
65 silent_gen_rst
= ${gen_rst}
67 $(BUILDDIR
)/audio.h.rst
: ${UAPI}/dvb
/audio.h
${PARSER} $(SRC_DIR
)/audio.h.rst.exceptions
70 $(BUILDDIR
)/ca.h.rst
: ${UAPI}/dvb
/ca.h
${PARSER} $(SRC_DIR
)/ca.h.rst.exceptions
73 $(BUILDDIR
)/dmx.h.rst
: ${UAPI}/dvb
/dmx.h
${PARSER} $(SRC_DIR
)/dmx.h.rst.exceptions
76 $(BUILDDIR
)/frontend.h.rst
: ${UAPI}/dvb
/frontend.h
${PARSER} $(SRC_DIR
)/frontend.h.rst.exceptions
79 $(BUILDDIR
)/net.h.rst
: ${UAPI}/dvb
/net.h
${PARSER} $(SRC_DIR
)/net.h.rst.exceptions
82 $(BUILDDIR
)/video.h.rst
: ${UAPI}/dvb
/video.h
${PARSER} $(SRC_DIR
)/video.h.rst.exceptions
85 $(BUILDDIR
)/videodev2.h.rst
: ${UAPI}/videodev2.h
${PARSER} $(SRC_DIR
)/videodev2.h.rst.exceptions
88 $(BUILDDIR
)/media.h.rst
: ${UAPI}/media.h
${PARSER} $(SRC_DIR
)/media.h.rst.exceptions
91 $(BUILDDIR
)/cec.h.rst
: ${KAPI}/cec.h
${PARSER} $(SRC_DIR
)/cec.h.rst.exceptions
94 $(BUILDDIR
)/lirc.h.rst
: ${UAPI}/lirc.h
${PARSER} $(SRC_DIR
)/lirc.h.rst.exceptions
99 .PHONY
: all html epub xml latex
101 all: $(IMGDOT
) $(BUILDDIR
) ${TARGETS}
108 -rm -f
$(DOTTGT
) $(IMGTGT
) ${TARGETS} 2>/dev
/null