blob: f9fd615427fbd4c0a718d66ed1b7de006ab796e6 [file] [log] [blame]
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -03001###
2# Media build rules - Auto-generates media contents/indexes and *.h xml's
3#
4
5SHELL=/bin/bash
6
7MEDIA_OBJ_DIR=$(objtree)/Documentation/DocBook/
8MEDIA_SRC_DIR=$(srctree)/Documentation/DocBook/media
9
10MEDIA_TEMP = media-entities.tmpl \
11 media-indices.tmpl \
12 videodev2.h.xml \
13 v4l2.xml \
Mauro Carvalho Chehabd9d73412011-06-08 10:23:34 -030014 audio.h.xml \
15 ca.h.xml \
16 dmx.h.xml \
17 frontend.h.xml \
18 net.h.xml \
Mauro Carvalho Chehabd9d73412011-06-08 10:23:34 -030019 video.h.xml \
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -030020
Mauro Carvalho Chehabbd7319d2011-06-15 23:13:19 -030021IMGFILES := $(patsubst %.b64,%, $(notdir $(shell ls $(MEDIA_SRC_DIR)/*.b64)))
22OBJIMGFILES := $(addprefix $(MEDIA_OBJ_DIR)/, $(IMGFILES))
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -030023GENFILES := $(addprefix $(MEDIA_OBJ_DIR)/, $(MEDIA_TEMP))
24
Mauro Carvalho Chehaba012fb22011-06-09 16:34:29 -030025PHONY += cleanmediadocs
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -030026
27cleanmediadocs:
Mauro Carvalho Chehabbd7319d2011-06-15 23:13:19 -030028 -@rm `find $(MEDIA_OBJ_DIR) -type l` $(GENFILES) $(OBJIMGFILES) 2>/dev/null
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -030029
30$(obj)/media_api.xml: $(GENFILES) FORCE
31
32#$(MEDIA_OBJ_DIR)/media_api.html: $(MEDIA_OBJ_DIR)/media_api.xml
33#$(MEDIA_OBJ_DIR)/media_api.pdf: $(MEDIA_OBJ_DIR)/media_api.xml
34#$(MEDIA_OBJ_DIR)/media_api.ps: $(MEDIA_OBJ_DIR)/media_api.xml
35
36V4L_SGMLS = \
37 $(shell ls $(MEDIA_SRC_DIR)/v4l/*.xml|perl -ne 'print "$$1 " if (m,.*/(.*)\n,)') \
38 capture.c.xml \
39 keytable.c.xml \
40 v4l2grab.c.xml
41
42DVB_SGMLS = \
43 $(shell ls $(MEDIA_SRC_DIR)/dvb/*.xml|perl -ne 'print "$$1 " if (m,.*/(.*)\n,)')
44
45MEDIA_SGMLS = $(addprefix ./,$(V4L_SGMLS)) $(addprefix ./,$(DVB_SGMLS)) $(addprefix ./,$(MEDIA_TEMP))
46
47FUNCS = \
48 close \
49 ioctl \
50 mmap \
51 munmap \
52 open \
53 poll \
54 read \
55 select \
56 write \
57
58IOCTLS = \
Mauro Carvalho Chehabce3b5952012-10-17 10:05:09 -030059 $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/uapi/linux/videodev2.h) \
60 $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/uapi/linux/dvb/audio.h) \
61 $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/uapi/linux/dvb/ca.h) \
62 $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/uapi/linux/dvb/dmx.h) \
63 $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/uapi/linux/dvb/frontend.h) \
64 $(shell perl -ne 'print "$$1 " if /\#define\s+([A-Z][^\s]+)\s+_IO/' $(srctree)/include/uapi/linux/dvb/net.h) \
65 $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/uapi/linux/dvb/video.h) \
66 $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/uapi/linux/media.h) \
67 $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/uapi/linux/v4l2-subdev.h) \
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -030068 VIDIOC_SUBDEV_G_FRAME_INTERVAL \
69 VIDIOC_SUBDEV_S_FRAME_INTERVAL \
70 VIDIOC_SUBDEV_ENUM_MBUS_CODE \
71 VIDIOC_SUBDEV_ENUM_FRAME_SIZE \
72 VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL \
Sakari Ailus955f6452011-12-12 18:17:25 -030073 VIDIOC_SUBDEV_G_SELECTION \
74 VIDIOC_SUBDEV_S_SELECTION \
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -030075
76TYPES = \
Mauro Carvalho Chehabce3b5952012-10-17 10:05:09 -030077 $(shell perl -ne 'print "$$1 " if /^typedef\s+[^\s]+\s+([^\s]+)\;/' $(srctree)/include/uapi/linux/videodev2.h) \
78 $(shell perl -ne 'print "$$1 " if /^}\s+([a-z0-9_]+_t)/' $(srctree)/include/uapi/linux/dvb/frontend.h)
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -030079
80ENUMS = \
Mauro Carvalho Chehabce3b5952012-10-17 10:05:09 -030081 $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/videodev2.h) \
82 $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/audio.h) \
83 $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/ca.h) \
84 $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/dmx.h) \
85 $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/frontend.h) \
86 $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/net.h) \
87 $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/video.h) \
88 $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/media.h) \
89 $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/v4l2-mediabus.h) \
90 $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/v4l2-subdev.h)
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -030091
92STRUCTS = \
Mauro Carvalho Chehabce3b5952012-10-17 10:05:09 -030093 $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/videodev2.h) \
94 $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s\{]+)\s*/)' $(srctree)/include/uapi/linux/dvb/audio.h) \
95 $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/)' $(srctree)/include/uapi/linux/dvb/ca.h) \
96 $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/)' $(srctree)/include/uapi/linux/dvb/dmx.h) \
97 $(shell perl -ne 'print "$$1 " if (!/dtv\_cmds\_h/ && /^struct\s+([^\s]+)\s+/)' $(srctree)/include/uapi/linux/dvb/frontend.h) \
98 $(shell perl -ne 'print "$$1 " if (/^struct\s+([A-Z][^\s]+)\s+/)' $(srctree)/include/uapi/linux/dvb/net.h) \
99 $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/)' $(srctree)/include/uapi/linux/dvb/video.h) \
100 $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/media.h) \
101 $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/v4l2-subdev.h) \
102 $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/v4l2-mediabus.h)
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -0300103
104ERRORS = \
Mauro Carvalho Chehab6d172492011-07-05 10:07:37 -0300105 E2BIG \
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -0300106 EACCES \
107 EAGAIN \
108 EBADF \
Mauro Carvalho Chehab6d172492011-07-05 10:07:37 -0300109 EBADFD \
110 EBADR \
111 EBADRQC \
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -0300112 EBUSY \
Mauro Carvalho Chehab6d172492011-07-05 10:07:37 -0300113 ECHILD \
114 ECONNRESET \
115 EDEADLK \
116 EDOM \
117 EEXIST \
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -0300118 EFAULT \
Mauro Carvalho Chehab6d172492011-07-05 10:07:37 -0300119 EFBIG \
120 EILSEQ \
121 EINIT \
122 EINPROGRESS \
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -0300123 EINTR \
124 EINVAL \
Mauro Carvalho Chehab6d172492011-07-05 10:07:37 -0300125 EIO \
126 EMFILE \
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -0300127 ENFILE \
Mauro Carvalho Chehab6d172492011-07-05 10:07:37 -0300128 ENOBUFS \
129 ENODATA \
130 ENODEV \
131 ENOENT \
132 ENOIOCTLCMD \
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -0300133 ENOMEM \
134 ENOSPC \
Mauro Carvalho Chehab6d172492011-07-05 10:07:37 -0300135 ENOSR \
136 ENOSYS \
137 ENOTSUP \
138 ENOTSUPP \
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -0300139 ENOTTY \
140 ENXIO \
Mauro Carvalho Chehab6d172492011-07-05 10:07:37 -0300141 EOPNOTSUPP \
142 EOVERFLOW \
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -0300143 EPERM \
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -0300144 EPIPE \
Mauro Carvalho Chehab6d172492011-07-05 10:07:37 -0300145 EPROTO \
146 ERANGE \
147 EREMOTE \
148 EREMOTEIO \
149 ERESTART \
150 ERESTARTSYS \
151 ESHUTDOWN \
152 ESPIPE \
153 ETIME \
154 ETIMEDOUT \
155 EUSERS \
156 EWOULDBLOCK \
157 EXDEV \
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -0300158
159ESCAPE = \
160 -e "s/&/\\&/g" \
161 -e "s/</\\&lt;/g" \
162 -e "s/>/\\&gt;/g"
163
164FILENAME = \
165 -e s,"^[^\/]*/",, \
166 -e s/"\\.xml"// \
167 -e s/"\\.tmpl"// \
168 -e s/\\\./-/g \
169 -e s/"^func-"// \
170 -e s/"^pixfmt-"// \
171 -e s/"^vidioc-"//
172
173# Generate references to these structs in videodev2.h.xml.
174DOCUMENTED = \
175 -e "s/\(enum *\)v4l2_mpeg_cx2341x_video_\([a-z]*_spatial_filter_type\)/\1<link linkend=\"\2\">v4l2_mpeg_cx2341x_video_\2<\/link>/g" \
176 -e "s/\(\(enum\|struct\) *\)\(v4l2_[a-zA-Z0-9_]*\)/\1<link linkend=\"\3\">\3<\/link>/g" \
177 -e "s/\(V4L2_PIX_FMT_[A-Z0-9_]\+\) /<link linkend=\"\1\">\1<\/link> /g" \
178 -e ":a;s/\(linkend=\".*\)_\(.*\">\)/\1-\2/;ta" \
179 -e "s/v4l2\-mpeg\-vbi\-ITV0/v4l2-mpeg-vbi-itv0-1/g"
180
181DVB_DOCUMENTED = \
Mauro Carvalho Chehab98a2b602011-06-07 14:51:56 -0300182 -e "s/\(linkend\=\"\)FE_SET_PROPERTY/\1FE_GET_PROPERTY/g" \
183 -e "s,\(struct\s\+\)\([a-z0-9_]\+\)\(\s\+{\),\1\<link linkend=\"\2\">\2\<\/link\>\3,g" \
184 -e "s,\(}\s\+\)\([a-z0-9_]\+_t\+\),\1\<link linkend=\"\2\">\2\<\/link\>,g" \
Mauro Carvalho Chehab95e61e02011-06-07 16:58:00 -0300185 -e "s,\(define\s\+\)\(DTV_[A-Z0-9_]\+\)\(\s\+[0-9]\+\),\1\<link linkend=\"\2\">\2\<\/link\>\3,g" \
Mauro Carvalho Chehabca5b2332011-06-08 15:08:57 -0300186 -e "s,<link\s\+linkend=\".*\">\(DTV_IOCTL_MAX_MSGS\|dtv_cmds_h\|__.*_old\)<\/link>,\1,g" \
Mauro Carvalho Chehabd5dc2de2011-06-07 16:17:00 -0300187 -e ":a;s/\(linkend=\".*\)_\(.*\">\)/\1-\2/;ta" \
Mauro Carvalho Chehabdc05e572011-06-08 15:39:05 -0300188 -e "s,\(audio-mixer\|audio-karaoke\|audio-status\|ca-slot-info\|ca-descr-info\|ca-caps\|ca-msg\|ca-descr\|ca-pid\|dmx-filter\|dmx-caps\|video-system\|video-highlight\|video-spu\|video-spu-palette\|video-navi-pack\)-t,\1,g" \
Mauro Carvalho Chehab95e61e02011-06-07 16:58:00 -0300189 -e "s,DTV-ISDBT-LAYER[A-C],DTV-ISDBT-LAYER,g" \
Mauro Carvalho Chehab6cb77a82011-06-07 17:58:59 -0300190 -e "s,\(define\s\+\)\([A-Z0-9_]\+\)\(\s\+_IO\),\1\<link linkend=\"\2\">\2\<\/link\>\3,g" \
Mauro Carvalho Chehabca5b2332011-06-08 15:08:57 -0300191 -e "s,<link\s\+linkend=\".*\">\(__.*_OLD\)<\/link>,\1,g" \
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -0300192
193#
194# Media targets and dependencies
195#
196
Mauro Carvalho Chehabbd7319d2011-06-15 23:13:19 -0300197install_media_images = \
Sakari Ailus955f6452011-12-12 18:17:25 -0300198 $(Q)cp $(OBJIMGFILES) $(MEDIA_SRC_DIR)/v4l/*.svg $(MEDIA_OBJ_DIR)/media_api
Mauro Carvalho Chehabbd7319d2011-06-15 23:13:19 -0300199
200$(MEDIA_OBJ_DIR)/%: $(MEDIA_SRC_DIR)/%.b64
201 $(Q)base64 -d $< >$@
202
203$(MEDIA_OBJ_DIR)/v4l2.xml: $(OBJIMGFILES)
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -0300204 @$($(quiet)gen_xml)
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -0300205 @(ln -sf $(MEDIA_SRC_DIR)/v4l/*xml $(MEDIA_OBJ_DIR)/)
206 @(ln -sf $(MEDIA_SRC_DIR)/dvb/*xml $(MEDIA_OBJ_DIR)/)
207
Mauro Carvalho Chehabce3b5952012-10-17 10:05:09 -0300208$(MEDIA_OBJ_DIR)/videodev2.h.xml: $(srctree)/include/uapi/linux/videodev2.h $(MEDIA_OBJ_DIR)/v4l2.xml
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -0300209 @$($(quiet)gen_xml)
210 @( \
211 echo "<programlisting>") > $@
212 @( \
213 expand --tabs=8 < $< | \
214 sed $(ESCAPE) $(DOCUMENTED) | \
215 sed 's/i\.e\./&ie;/') >> $@
216 @( \
217 echo "</programlisting>") >> $@
218
Mauro Carvalho Chehabce3b5952012-10-17 10:05:09 -0300219$(MEDIA_OBJ_DIR)/audio.h.xml: $(srctree)/include/uapi/linux/dvb/audio.h $(MEDIA_OBJ_DIR)/v4l2.xml
Mauro Carvalho Chehabd9d73412011-06-08 10:23:34 -0300220 @$($(quiet)gen_xml)
221 @( \
222 echo "<programlisting>") > $@
223 @( \
224 expand --tabs=8 < $< | \
225 sed $(ESCAPE) $(DVB_DOCUMENTED) | \
226 sed 's/i\.e\./&ie;/') >> $@
227 @( \
228 echo "</programlisting>") >> $@
229
Mauro Carvalho Chehabce3b5952012-10-17 10:05:09 -0300230$(MEDIA_OBJ_DIR)/ca.h.xml: $(srctree)/include/uapi/linux/dvb/ca.h $(MEDIA_OBJ_DIR)/v4l2.xml
Mauro Carvalho Chehabd9d73412011-06-08 10:23:34 -0300231 @$($(quiet)gen_xml)
232 @( \
233 echo "<programlisting>") > $@
234 @( \
235 expand --tabs=8 < $< | \
236 sed $(ESCAPE) $(DVB_DOCUMENTED) | \
237 sed 's/i\.e\./&ie;/') >> $@
238 @( \
239 echo "</programlisting>") >> $@
240
Mauro Carvalho Chehabce3b5952012-10-17 10:05:09 -0300241$(MEDIA_OBJ_DIR)/dmx.h.xml: $(srctree)/include/uapi/linux/dvb/dmx.h $(MEDIA_OBJ_DIR)/v4l2.xml
Mauro Carvalho Chehabd9d73412011-06-08 10:23:34 -0300242 @$($(quiet)gen_xml)
243 @( \
244 echo "<programlisting>") > $@
245 @( \
246 expand --tabs=8 < $< | \
247 sed $(ESCAPE) $(DVB_DOCUMENTED) | \
248 sed 's/i\.e\./&ie;/') >> $@
249 @( \
250 echo "</programlisting>") >> $@
251
Mauro Carvalho Chehabce3b5952012-10-17 10:05:09 -0300252$(MEDIA_OBJ_DIR)/frontend.h.xml: $(srctree)/include/uapi/linux/dvb/frontend.h $(MEDIA_OBJ_DIR)/v4l2.xml
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -0300253 @$($(quiet)gen_xml)
254 @( \
255 echo "<programlisting>") > $@
256 @( \
257 expand --tabs=8 < $< | \
258 sed $(ESCAPE) $(DVB_DOCUMENTED) | \
259 sed 's/i\.e\./&ie;/') >> $@
260 @( \
261 echo "</programlisting>") >> $@
262
Mauro Carvalho Chehabce3b5952012-10-17 10:05:09 -0300263$(MEDIA_OBJ_DIR)/net.h.xml: $(srctree)/include/uapi/linux/dvb/net.h $(MEDIA_OBJ_DIR)/v4l2.xml
Mauro Carvalho Chehabd9d73412011-06-08 10:23:34 -0300264 @$($(quiet)gen_xml)
265 @( \
266 echo "<programlisting>") > $@
267 @( \
268 expand --tabs=8 < $< | \
269 sed $(ESCAPE) $(DVB_DOCUMENTED) | \
270 sed 's/i\.e\./&ie;/') >> $@
271 @( \
272 echo "</programlisting>") >> $@
273
Mauro Carvalho Chehabce3b5952012-10-17 10:05:09 -0300274$(MEDIA_OBJ_DIR)/video.h.xml: $(srctree)/include/uapi/linux/dvb/video.h $(MEDIA_OBJ_DIR)/v4l2.xml
Mauro Carvalho Chehabd9d73412011-06-08 10:23:34 -0300275 @$($(quiet)gen_xml)
276 @( \
277 echo "<programlisting>") > $@
278 @( \
279 expand --tabs=8 < $< | \
280 sed $(ESCAPE) $(DVB_DOCUMENTED) | \
281 sed 's/i\.e\./&ie;/') >> $@
282 @( \
283 echo "</programlisting>") >> $@
284
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -0300285$(MEDIA_OBJ_DIR)/media-entities.tmpl: $(MEDIA_OBJ_DIR)/v4l2.xml
286 @$($(quiet)gen_xml)
287 @( \
288 echo "<!-- Generated file! Do not edit. -->") >$@
289 @( \
290 echo -e "\n<!-- Functions -->") >>$@
291 @( \
292 for ident in $(FUNCS) ; do \
293 entity=`echo $$ident | tr _ -` ; \
294 echo "<!ENTITY func-$$entity \"<link" \
295 "linkend='func-$$entity'><function>$$ident()</function></link>\">" \
296 >>$@ ; \
297 done)
298 @( \
299 echo -e "\n<!-- Ioctls -->") >>$@
300 @( \
301 for ident in $(IOCTLS) ; do \
302 entity=`echo $$ident | tr _ -` ; \
Hans Verkuil071408b2012-08-14 06:10:01 -0300303 id=`grep "<refname>$$ident" $(MEDIA_OBJ_DIR)/vidioc-*.xml $(MEDIA_OBJ_DIR)/media-ioc-*.xml | sed -r s,"^.*/(.*).xml.*","\1",` ; \
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -0300304 echo "<!ENTITY $$entity \"<link" \
305 "linkend='$$id'><constant>$$ident</constant></link>\">" \
306 >>$@ ; \
307 done)
308 @( \
309 echo -e "\n<!-- Types -->") >>$@
310 @( \
311 for ident in $(TYPES) ; do \
312 entity=`echo $$ident | tr _ -` ; \
313 echo "<!ENTITY $$entity \"<link" \
314 "linkend='$$entity'>$$ident</link>\">" >>$@ ; \
315 done)
316 @( \
317 echo -e "\n<!-- Enums -->") >>$@
318 @( \
319 for ident in $(ENUMS) ; do \
320 entity=`echo $$ident | sed -e "s/v4l2_mpeg_cx2341x_video_\([a-z]*_spatial_filter_type\)/\1/" | tr _ -` ; \
321 echo "<!ENTITY $$entity \"enum&nbsp;<link" \
322 "linkend='$$entity'>$$ident</link>\">" >>$@ ; \
323 done)
324 @( \
325 echo -e "\n<!-- Structures -->") >>$@
326 @( \
327 for ident in $(STRUCTS) ; do \
328 entity=`echo $$ident | tr _ - | sed s/v4l2-mpeg-vbi-ITV0/v4l2-mpeg-vbi-itv0-1/g` ; \
329 echo "<!ENTITY $$entity \"struct&nbsp;<link" \
330 "linkend='$$entity'>$$ident</link>\">" >>$@ ; \
331 done)
332 @( \
333 echo -e "\n<!-- Error Codes -->") >>$@
334 @( \
335 for ident in $(ERRORS) ; do \
336 echo "<!ENTITY $$ident \"<errorcode>$$ident</errorcode>" \
337 "error code\">" >>$@ ; \
338 done)
339 @( \
340 echo -e "\n<!-- Subsections -->") >>$@
341 @( \
342 for file in $(MEDIA_SGMLS) ; do \
343 entity=`echo "$$file" | sed $(FILENAME) -e s/"^([^-]*)"/sub\1/` ; \
344 if ! echo "$$file" | \
345 grep -q -E -e '^(func|vidioc|pixfmt)-' ; then \
346 echo "<!ENTITY sub-$$entity SYSTEM \"$$file\">" >>$@ ; \
347 fi ; \
348 done)
349 @( \
350 echo -e "\n<!-- Function Reference -->") >>$@
351 @( \
352 for file in $(MEDIA_SGMLS) ; do \
353 if echo "$$file" | \
354 grep -q -E -e '(func|vidioc|pixfmt)-' ; then \
355 entity=`echo "$$file" |sed $(FILENAME)` ; \
356 echo "<!ENTITY $$entity SYSTEM \"$$file\">" >>$@ ; \
357 fi ; \
358 done)
359
360# Jade can auto-generate a list-of-tables, which includes all structs,
361# but we only want data types, all types, and sorted please.
362$(MEDIA_OBJ_DIR)/media-indices.tmpl: $(MEDIA_OBJ_DIR)/v4l2.xml
363 @$($(quiet)gen_xml)
364 @( \
365 echo "<!-- Generated file! Do not edit. -->") >$@
366 @( \
367 echo -e "\n<index><title>List of Types</title>") >>$@
368 @( \
369 for ident in $(TYPES) ; do \
370 id=`echo $$ident | tr _ -` ; \
371 echo "<indexentry><primaryie><link" \
372 "linkend='$$id'>$$ident</link></primaryie></indexentry>" >>$@ ; \
373 done)
374 @( \
375 for ident in $(ENUMS) ; do \
376 id=`echo $$ident | sed -e "s/v4l2_mpeg_cx2341x_video_\([a-z]*_spatial_filter_type\)/\1/" | tr _ -`; \
377 echo "<indexentry><primaryie>enum&nbsp;<link" \
378 "linkend='$$id'>$$ident</link></primaryie></indexentry>" >>$@ ; \
379 done)
380 @( \
381 for ident in $(STRUCTS) ; do \
382 id=`echo $$ident | tr _ - | sed s/v4l2-mpeg-vbi-ITV0/v4l2-mpeg-vbi-itv0-1/g` ; \
383 echo "<indexentry><primaryie>struct&nbsp;<link" \
384 "linkend='$$id'>$$ident</link></primaryie></indexentry>" >>$@ ; \
385 done)
386 @( \
387 echo "</index>") >>$@
388