From: Mauro Carvalho Chehab <mchehab@infradead.org>
To: Markus Heiser <markus.heiser@darmarit.de>
Cc: Jonathan Corbet <corbet@lwn.net>,
Jani Nikula <jani.nikula@intel.com>,
Linux Media Mailing List <linux-media@vger.kernel.org>,
linux-doc@vger.kernel.org
Subject: Re: [PATCH 3/4] doc-rst: migrated media build kernel-cmd directive
Date: Thu, 6 Oct 2016 08:46:41 -0300 [thread overview]
Message-ID: <20161006084641.7cbaf3cf@vento.lan> (raw)
In-Reply-To: <1475738420-8747-4-git-send-email-markus.heiser@darmarit.de>
Em Thu, 6 Oct 2016 09:20:19 +0200
Markus Heiser <markus.heiser@darmarit.de> escreveu:
> From: Markus Heiser <markus.heiser@darmarIT.de>
>
> From: Markus Heiser <markus.heiser@darmarIT.de>
>
> Remove the media-Makefile and migrate the ``.. kernel-include::``
> directive to the new ``.. kernel-cmd::`` directive.
>
> To avoid breaking bisect, this patch includes the required changes to
> the implementation (script ``parse-headers.pl``) and the content (*.rst
> files).
It is a way easier to review this patch if you do a diff with the
-M option, as below.
---
doc-rst: migrated media build kernel-cmd directive
From: Markus Heiser <markus.heiser@darmarIT.de>
Remove the media-Makefile and migrate the ``.. kernel-include::``
directive to the new ``.. kernel-cmd::`` directive.
To avoid breaking bisect, this patch includes the required changes to
the implementation (script ``parse-headers.pl``) and the content (*.rst
files).
Signed-off-by: Markus Heiser <markus.heiser@darmarIT.de>
Documentation/Makefile.sphinx | 2 +-
Documentation/media/Makefile | 61 ----------------------
| 3 +-
.../cec/cec.h.exceptions} | 0
.../dvb/audio.h.exceptions} | 0
Documentation/media/uapi/dvb/audio_h.rst | 2 +-
.../dvb/ca.h.exceptions} | 0
Documentation/media/uapi/dvb/ca_h.rst | 2 +-
.../dvb/dmx.h.exceptions} | 0
Documentation/media/uapi/dvb/dmx_h.rst | 2 +-
.../dvb/frontend.h.exceptions} | 0
Documentation/media/uapi/dvb/frontend_h.rst | 2 +-
.../dvb/net.h.exceptions} | 0
Documentation/media/uapi/dvb/net_h.rst | 2 +-
.../dvb/video.h.exceptions} | 0
Documentation/media/uapi/dvb/video_h.rst | 2 +-
| 3 +-
.../mediactl/media.h.exceptions} | 0
| 2 +-
.../rc/lirc.h.exceptions} | 0
Documentation/media/uapi/v4l/videodev.rst | 2 +-
.../v4l/videodev2.h.exceptions} | 0
| 17 +++---
23 files changed, 18 insertions(+), 84 deletions(-)
diff --git a/Documentation/Makefile.sphinx b/Documentation/Makefile.sphinx
index 92deea30b183..2e033e4e0e60 100644
--- a/Documentation/Makefile.sphinx
+++ b/Documentation/Makefile.sphinx
@@ -52,7 +52,7 @@ loop_cmd = $(echo-cmd) $(cmd_$(1))
# e.g. "media" for the linux-tv book-set at ./Documentation/media
quiet_cmd_sphinx = SPHINX $@ --> file://$(abspath $(BUILDDIR)/$3/$4);
- cmd_sphinx = $(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/media all;\
+ cmd_sphinx = \
BUILDDIR=$(abspath $(BUILDDIR)) SPHINX_CONF=$(abspath $(srctree)/$(src)/$5/$(SPHINX_CONF)) \
$(SPHINXBUILD) \
-b $2 \
diff --git a/Documentation/media/Makefile b/Documentation/media/Makefile
deleted file mode 100644
index a7fb35291f6c..000000000000
--- a/Documentation/media/Makefile
+++ /dev/null
@@ -1,61 +0,0 @@
-# Generate the *.h.rst files from uAPI headers
-
-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))
-
-.PHONY: all
-all: $(BUILDDIR) ${TARGETS}
-
-$(BUILDDIR):
- $(Q)mkdir -p $@
-
-# Rule to convert a .h file to inline RST documentation
-
-gen_rst = \
- echo ${PARSER} $< $@ $(SRC_DIR)/$(notdir $@).exceptions; \
- ${PARSER} $< $@ $(SRC_DIR)/$(notdir $@).exceptions
-
-quiet_gen_rst = echo ' PARSE $(patsubst $(srctree)/%,%,$<)'; \
- ${PARSER} $< $@ $(SRC_DIR)/$(notdir $@).exceptions
-
-silent_gen_rst = ${gen_rst}
-
-$(BUILDDIR)/audio.h.rst: ${UAPI}/dvb/audio.h ${PARSER} $(SRC_DIR)/audio.h.rst.exceptions
- @$($(quiet)gen_rst)
-
-$(BUILDDIR)/ca.h.rst: ${UAPI}/dvb/ca.h ${PARSER} $(SRC_DIR)/ca.h.rst.exceptions
- @$($(quiet)gen_rst)
-
-$(BUILDDIR)/dmx.h.rst: ${UAPI}/dvb/dmx.h ${PARSER} $(SRC_DIR)/dmx.h.rst.exceptions
- @$($(quiet)gen_rst)
-
-$(BUILDDIR)/frontend.h.rst: ${UAPI}/dvb/frontend.h ${PARSER} $(SRC_DIR)/frontend.h.rst.exceptions
- @$($(quiet)gen_rst)
-
-$(BUILDDIR)/net.h.rst: ${UAPI}/dvb/net.h ${PARSER} $(SRC_DIR)/net.h.rst.exceptions
- @$($(quiet)gen_rst)
-
-$(BUILDDIR)/video.h.rst: ${UAPI}/dvb/video.h ${PARSER} $(SRC_DIR)/video.h.rst.exceptions
- @$($(quiet)gen_rst)
-
-$(BUILDDIR)/videodev2.h.rst: ${UAPI}/videodev2.h ${PARSER} $(SRC_DIR)/videodev2.h.rst.exceptions
- @$($(quiet)gen_rst)
-
-$(BUILDDIR)/media.h.rst: ${UAPI}/media.h ${PARSER} $(SRC_DIR)/media.h.rst.exceptions
- @$($(quiet)gen_rst)
-
-$(BUILDDIR)/cec.h.rst: ${KAPI}/cec.h ${PARSER} $(SRC_DIR)/cec.h.rst.exceptions
- @$($(quiet)gen_rst)
-
-$(BUILDDIR)/lirc.h.rst: ${UAPI}/lirc.h ${PARSER} $(SRC_DIR)/lirc.h.rst.exceptions
- @$($(quiet)gen_rst)
-
-cleandocs:
- -rm ${TARGETS}
--git a/Documentation/media/uapi/cec/cec-header.rst b/Documentation/media/uapi/cec/cec-header.rst
index d5a9a2828274..c50cf7ff7892 100644
--- a/Documentation/media/uapi/cec/cec-header.rst
+++ b/Documentation/media/uapi/cec/cec-header.rst
@@ -6,5 +6,4 @@
CEC Header File
***************
-.. kernel-include:: $BUILDDIR/cec.h.rst
-
+.. kernel-cmd:: parse-headers.pl $srctree/include/linux/cec.h cec.h.exceptions
diff --git a/Documentation/media/cec.h.rst.exceptions b/Documentation/media/uapi/cec/cec.h.exceptions
similarity index 100%
rename from Documentation/media/cec.h.rst.exceptions
rename to Documentation/media/uapi/cec/cec.h.exceptions
diff --git a/Documentation/media/audio.h.rst.exceptions b/Documentation/media/uapi/dvb/audio.h.exceptions
similarity index 100%
rename from Documentation/media/audio.h.rst.exceptions
rename to Documentation/media/uapi/dvb/audio.h.exceptions
diff --git a/Documentation/media/uapi/dvb/audio_h.rst b/Documentation/media/uapi/dvb/audio_h.rst
index e00c3010fdf9..8d9eff2ac236 100644
--- a/Documentation/media/uapi/dvb/audio_h.rst
+++ b/Documentation/media/uapi/dvb/audio_h.rst
@@ -6,4 +6,4 @@
DVB Audio Header File
*********************
-.. kernel-include:: $BUILDDIR/audio.h.rst
+.. kernel-cmd:: parse-headers.pl $srctree/include/uapi/linux/dvb/audio.h audio.h.exceptions
diff --git a/Documentation/media/ca.h.rst.exceptions b/Documentation/media/uapi/dvb/ca.h.exceptions
similarity index 100%
rename from Documentation/media/ca.h.rst.exceptions
rename to Documentation/media/uapi/dvb/ca.h.exceptions
diff --git a/Documentation/media/uapi/dvb/ca_h.rst b/Documentation/media/uapi/dvb/ca_h.rst
index f513592ef529..57d47de8518a 100644
--- a/Documentation/media/uapi/dvb/ca_h.rst
+++ b/Documentation/media/uapi/dvb/ca_h.rst
@@ -6,4 +6,4 @@
DVB Conditional Access Header File
**********************************
-.. kernel-include:: $BUILDDIR/ca.h.rst
+.. kernel-cmd:: parse-headers.pl $srctree/include/uapi/linux/dvb/ca.h ca.h.exceptions
diff --git a/Documentation/media/dmx.h.rst.exceptions b/Documentation/media/uapi/dvb/dmx.h.exceptions
similarity index 100%
rename from Documentation/media/dmx.h.rst.exceptions
rename to Documentation/media/uapi/dvb/dmx.h.exceptions
diff --git a/Documentation/media/uapi/dvb/dmx_h.rst b/Documentation/media/uapi/dvb/dmx_h.rst
index 4fd1704a0833..90f965be979c 100644
--- a/Documentation/media/uapi/dvb/dmx_h.rst
+++ b/Documentation/media/uapi/dvb/dmx_h.rst
@@ -6,4 +6,4 @@
DVB Demux Header File
*********************
-.. kernel-include:: $BUILDDIR/dmx.h.rst
+.. kernel-cmd:: parse-headers.pl $srctree/include/uapi/linux/dvb/dmx.h dmx.h.exceptions
diff --git a/Documentation/media/frontend.h.rst.exceptions b/Documentation/media/uapi/dvb/frontend.h.exceptions
similarity index 100%
rename from Documentation/media/frontend.h.rst.exceptions
rename to Documentation/media/uapi/dvb/frontend.h.exceptions
diff --git a/Documentation/media/uapi/dvb/frontend_h.rst b/Documentation/media/uapi/dvb/frontend_h.rst
index 15fca04d1c32..84a064f12fc8 100644
--- a/Documentation/media/uapi/dvb/frontend_h.rst
+++ b/Documentation/media/uapi/dvb/frontend_h.rst
@@ -6,4 +6,4 @@
DVB Frontend Header File
************************
-.. kernel-include:: $BUILDDIR/frontend.h.rst
+.. kernel-cmd:: parse-headers.pl $srctree/include/uapi/linux/dvb/frontend.h frontend.h.exceptions
diff --git a/Documentation/media/net.h.rst.exceptions b/Documentation/media/uapi/dvb/net.h.exceptions
similarity index 100%
rename from Documentation/media/net.h.rst.exceptions
rename to Documentation/media/uapi/dvb/net.h.exceptions
diff --git a/Documentation/media/uapi/dvb/net_h.rst b/Documentation/media/uapi/dvb/net_h.rst
index 7bcf5ba9d1eb..34ed22b09677 100644
--- a/Documentation/media/uapi/dvb/net_h.rst
+++ b/Documentation/media/uapi/dvb/net_h.rst
@@ -6,4 +6,4 @@
DVB Network Header File
***********************
-.. kernel-include:: $BUILDDIR/net.h.rst
+.. kernel-cmd:: parse-headers.pl $srctree/include/uapi/linux/dvb/net.h net.h.exceptions
diff --git a/Documentation/media/video.h.rst.exceptions b/Documentation/media/uapi/dvb/video.h.exceptions
similarity index 100%
rename from Documentation/media/video.h.rst.exceptions
rename to Documentation/media/uapi/dvb/video.h.exceptions
diff --git a/Documentation/media/uapi/dvb/video_h.rst b/Documentation/media/uapi/dvb/video_h.rst
index 3f39b0c4879c..c17b23e348a1 100644
--- a/Documentation/media/uapi/dvb/video_h.rst
+++ b/Documentation/media/uapi/dvb/video_h.rst
@@ -6,4 +6,4 @@
DVB Video Header File
*********************
-.. kernel-include:: $BUILDDIR/video.h.rst
+.. kernel-cmd:: parse-headers.pl $srctree/include/uapi/linux/dvb/video.h video.h.exceptions
--git a/Documentation/media/uapi/mediactl/media-header.rst b/Documentation/media/uapi/mediactl/media-header.rst
index 96f7b0155e5a..27fe91dd7606 100644
--- a/Documentation/media/uapi/mediactl/media-header.rst
+++ b/Documentation/media/uapi/mediactl/media-header.rst
@@ -6,5 +6,4 @@
Media Controller Header File
****************************
-.. kernel-include:: $BUILDDIR/media.h.rst
-
+.. kernel-cmd:: parse-headers.pl $srctree/include/uapi/linux/media.h media.h.exceptions
--git a/Documentation/media/media.h.rst.exceptions b/Documentation/media/uapi/mediactl/media.h.exceptions
similarity index 100%
rename from Documentation/media/media.h.rst.exceptions
rename to Documentation/media/uapi/mediactl/media.h.exceptions
diff --git a/Documentation/media/uapi/rc/lirc-header.rst b/Documentation/media/uapi/rc/lirc-header.rst
index 487fe00e5517..923f10f7f156 100644
--- a/Documentation/media/uapi/rc/lirc-header.rst
+++ b/Documentation/media/uapi/rc/lirc-header.rst
@@ -6,5 +6,5 @@
LIRC Header File
****************
-.. kernel-include:: $BUILDDIR/lirc.h.rst
+.. kernel-cmd:: parse-headers.pl $srctree/include/uapi/linux/lirc.h lirc.h.exceptions
diff --git a/Documentation/media/lirc.h.rst.exceptions b/Documentation/media/uapi/rc/lirc.h.exceptions
similarity index 100%
rename from Documentation/media/lirc.h.rst.exceptions
rename to Documentation/media/uapi/rc/lirc.h.exceptions
diff --git a/Documentation/media/uapi/v4l/videodev.rst b/Documentation/media/uapi/v4l/videodev.rst
index b9ee4672d639..6b36447e5f05 100644
--- a/Documentation/media/uapi/v4l/videodev.rst
+++ b/Documentation/media/uapi/v4l/videodev.rst
@@ -6,4 +6,4 @@
Video For Linux Two Header File
*******************************
-.. kernel-include:: $BUILDDIR/videodev2.h.rst
+.. kernel-cmd:: parse-headers.pl $srctree/include/uapi/linux/videodev2.h videodev2.h.exceptions
--git a/Documentation/media/videodev2.h.rst.exceptions b/Documentation/media/uapi/v4l/videodev2.h.exceptions
similarity index 100%
rename from Documentation/media/videodev2.h.rst.exceptions
rename to Documentation/media/uapi/v4l/videodev2.h.exceptions
diff --git a/Documentation/sphinx/parse-headers.pl b/Documentation/sphinx/parse-headers.pl
index 74089b0da798..92324a588879 100755
--- a/Documentation/sphinx/parse-headers.pl
+++ b/Documentation/sphinx/parse-headers.pl
@@ -9,10 +9,10 @@ use Text::Tabs;
my $debug = 0;
if (scalar @ARGV < 2 || scalar @ARGV > 3) {
- die "Usage:\n\t$0 <file in> <file out> [<exceptions file>]\n";
+ die "Usage:\n\t$0 <file in> [<exceptions file>]\n";
}
-my ($file_in, $file_out, $file_exceptions) = @ARGV;
+my ($file_in, $file_exceptions) = @ARGV;
my $data;
my %ioctls;
@@ -306,16 +306,13 @@ foreach my $r (keys %typedefs) {
$data =~ s/\\ \n/\n/g;
#
-# Generate output file
+# print generated content to stdout
#
my $title = $file_in;
$title =~ s,.*/,,;
-open OUT, "> $file_out" or die "Can't open $file_out";
-print OUT ".. -*- coding: utf-8; mode: rst -*-\n\n";
-print OUT "$title\n";
-print OUT "=" x length($title);
-print OUT "\n\n.. parsed-literal::\n\n";
-print OUT $data;
-close OUT;
+print "$title\n";
+print "=" x length($title);
+print "\n\n.. parsed-literal::\n\n";
+print $data;
next prev parent reply other threads:[~2016-10-06 11:46 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-06 7:20 [PATCH 0/4] reST-directive kernel-cmd / include contentent from scripts Markus Heiser
2016-10-06 7:20 ` [PATCH 1/4] doc-rst: " Markus Heiser
2016-10-17 16:46 ` Mauro Carvalho Chehab
2016-10-18 6:07 ` Jani Nikula
2016-10-18 6:52 ` Markus Heiser
2016-10-18 9:13 ` Mauro Carvalho Chehab
2016-10-18 7:03 ` Markus Heiser
2016-10-18 8:59 ` Mauro Carvalho Chehab
2016-10-18 10:06 ` Mauro Carvalho Chehab
2016-10-18 11:36 ` Markus Heiser
2016-10-06 7:20 ` [PATCH 2/4] doc-rst: customize RTD theme; literal-block Markus Heiser
2016-10-06 7:20 ` [PATCH 3/4] doc-rst: migrated media build kernel-cmd directive Markus Heiser
2016-10-06 11:46 ` Mauro Carvalho Chehab [this message]
2016-10-06 7:20 ` [PATCH 4/4] doc-rst: remove the kernel-include directive Markus Heiser
2016-10-06 8:42 ` [PATCH 0/4] reST-directive kernel-cmd / include contentent from scripts Jani Nikula
2016-10-06 13:31 ` Mauro Carvalho Chehab
2016-10-06 14:21 ` Jani Nikula
2016-10-06 16:50 ` Mauro Carvalho Chehab
2016-10-07 5:56 ` Jani Nikula
2016-10-11 7:26 ` Markus Heiser
2016-10-11 14:28 ` Mauro Carvalho Chehab
2016-10-11 15:34 ` Jani Nikula
2016-10-11 16:06 ` Markus Heiser
2016-10-11 16:45 ` Mauro Carvalho Chehab
2016-10-12 6:57 ` Markus Heiser
2016-10-12 8:20 ` Jani Nikula
2016-10-21 22:05 ` Jonathan Corbet
2016-10-22 10:56 ` Mauro Carvalho Chehab
2016-10-22 15:04 ` Jonathan Corbet
2016-10-22 16:46 ` Markus Heiser
2016-10-22 19:10 ` Mauro Carvalho Chehab
2016-10-23 11:20 ` Mauro Carvalho Chehab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161006084641.7cbaf3cf@vento.lan \
--to=mchehab@infradead.org \
--cc=corbet@lwn.net \
--cc=jani.nikula@intel.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=markus.heiser@darmarit.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.