docs-rst: media/Makefile: reorganize the rules
authorMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 30 Nov 2016 10:00:18 +0000 (08:00 -0200)
committerJonathan Corbet <corbet@lwn.net>
Thu, 1 Dec 2016 00:07:58 +0000 (17:07 -0700)
Better organize the media/Makefile, in order to better
split what's related to image conversion from the ones
related to parse-headers.pl.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Documentation/media/Makefile

index 547b410..ab05323 100644 (file)
@@ -1,15 +1,7 @@
-# Generate the *.h.rst files from uAPI headers
+# Rules to convert DOT and SVG to Sphinx images
 
-PARSER = $(srctree)/Documentation/sphinx/parse-headers.pl
-UAPI = $(srctree)/include/uapi/linux
-KAPI = $(srctree)/include/linux
 SRC_DIR=$(srctree)/Documentation/media
 
-FILES = audio.h.rst ca.h.rst dmx.h.rst frontend.h.rst net.h.rst video.h.rst \
-         videodev2.h.rst media.h.rst cec.h.rst lirc.h.rst
-
-TARGETS := $(addprefix $(BUILDDIR)/, $(FILES))
-
 DOTS = \
        uapi/v4l/pipeline.dot \
 
@@ -52,21 +44,16 @@ quiet_cmd_gendot = DOT     $2
 %.svg: %.dot
        @$(call cmd,gendot,$<,$@)
 
-.PHONY: all html epub xml latex
-
-all: $(IMGDOT) $(BUILDDIR) ${TARGETS}
-html: all
-epub: all
-xml: all
-latex: $(IMGPDF) all
+# Rules to convert a .h file to inline RST documentation
 
-clean:
-       -rm -f $(DOTTGT) $(IMGTGT) $(patsubst %,$(SRC_DIR)/%,${TARGETS}) 2>/dev/null
+PARSER = $(srctree)/Documentation/sphinx/parse-headers.pl
+UAPI = $(srctree)/include/uapi/linux
+KAPI = $(srctree)/include/linux
 
-$(BUILDDIR):
-       $(Q)mkdir -p $@
+FILES = audio.h.rst ca.h.rst dmx.h.rst frontend.h.rst net.h.rst video.h.rst \
+         videodev2.h.rst media.h.rst cec.h.rst lirc.h.rst
 
-# Rule to convert a .h file to inline RST documentation
+TARGETS := $(addprefix $(BUILDDIR)/, $(FILES))
 
 gen_rst = \
        echo ${PARSER} $< $@ $(SRC_DIR)/$(notdir $@).exceptions; \
@@ -106,3 +93,19 @@ $(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)
+
+# Media build rules
+
+.PHONY: all html epub xml latex
+
+all: $(IMGDOT) $(BUILDDIR) ${TARGETS}
+html: all
+epub: all
+xml: all
+latex: $(IMGPDF) all
+
+clean:
+       -rm -f $(DOTTGT) $(IMGTGT) $(patsubst %,$(SRC_DIR)/%,${TARGETS}) 2>/dev/null
+
+$(BUILDDIR):
+       $(Q)mkdir -p $@