blob: 6628b4b9cac49fb13ed96776ac9259f97e08d71d [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 = \
59 $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/linux/videodev2.h) \
Mauro Carvalho Chehabd9d73412011-06-08 10:23:34 -030060 $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/linux/dvb/audio.h) \
61 $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/linux/dvb/ca.h) \
62 $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/linux/dvb/dmx.h) \
Mauro Carvalho Chehab98a2b602011-06-07 14:51:56 -030063 $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/linux/dvb/frontend.h) \
Mauro Carvalho Chehabd9d73412011-06-08 10:23:34 -030064 $(shell perl -ne 'print "$$1 " if /\#define\s+([A-Z][^\s]+)\s+_IO/' $(srctree)/include/linux/dvb/net.h) \
Mauro Carvalho Chehabd9d73412011-06-08 10:23:34 -030065 $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/linux/dvb/video.h) \
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -030066 $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/linux/media.h) \
67 $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/linux/v4l2-subdev.h) \
68 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 \
73
74TYPES = \
Mauro Carvalho Chehab98a2b602011-06-07 14:51:56 -030075 $(shell perl -ne 'print "$$1 " if /^typedef\s+[^\s]+\s+([^\s]+)\;/' $(srctree)/include/linux/videodev2.h) \
76 $(shell perl -ne 'print "$$1 " if /^}\s+([a-z0-9_]+_t)/' $(srctree)/include/linux/dvb/frontend.h)
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -030077
78ENUMS = \
79 $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/videodev2.h) \
Mauro Carvalho Chehabd9d73412011-06-08 10:23:34 -030080 $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/dvb/audio.h) \
81 $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/dvb/ca.h) \
82 $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/dvb/dmx.h) \
Mauro Carvalho Chehab98a2b602011-06-07 14:51:56 -030083 $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/dvb/frontend.h) \
Mauro Carvalho Chehabd9d73412011-06-08 10:23:34 -030084 $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/dvb/net.h) \
Mauro Carvalho Chehabd9d73412011-06-08 10:23:34 -030085 $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/dvb/video.h) \
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -030086 $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/media.h) \
87 $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/v4l2-mediabus.h) \
88 $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/v4l2-subdev.h)
89
90STRUCTS = \
91 $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/linux/videodev2.h) \
Mauro Carvalho Chehabd9d73412011-06-08 10:23:34 -030092 $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s\{]+)\s*/)' $(srctree)/include/linux/dvb/audio.h) \
93 $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/)' $(srctree)/include/linux/dvb/ca.h) \
94 $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/)' $(srctree)/include/linux/dvb/dmx.h) \
Mauro Carvalho Chehab3272c3e2011-06-07 21:40:22 -030095 $(shell perl -ne 'print "$$1 " if (!/dtv\_cmds\_h/ && /^struct\s+([^\s]+)\s+/)' $(srctree)/include/linux/dvb/frontend.h) \
Mauro Carvalho Chehabd9d73412011-06-08 10:23:34 -030096 $(shell perl -ne 'print "$$1 " if (/^struct\s+([A-Z][^\s]+)\s+/)' $(srctree)/include/linux/dvb/net.h) \
Mauro Carvalho Chehabd9d73412011-06-08 10:23:34 -030097 $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/)' $(srctree)/include/linux/dvb/video.h) \
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -030098 $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/linux/media.h) \
99 $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/linux/v4l2-subdev.h) \
100 $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/linux/v4l2-mediabus.h)
101
102ERRORS = \
Mauro Carvalho Chehab6d172492011-07-05 10:07:37 -0300103 E2BIG \
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -0300104 EACCES \
105 EAGAIN \
106 EBADF \
Mauro Carvalho Chehab6d172492011-07-05 10:07:37 -0300107 EBADFD \
108 EBADR \
109 EBADRQC \
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -0300110 EBUSY \
Mauro Carvalho Chehab6d172492011-07-05 10:07:37 -0300111 ECHILD \
112 ECONNRESET \
113 EDEADLK \
114 EDOM \
115 EEXIST \
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -0300116 EFAULT \
Mauro Carvalho Chehab6d172492011-07-05 10:07:37 -0300117 EFBIG \
118 EILSEQ \
119 EINIT \
120 EINPROGRESS \
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -0300121 EINTR \
122 EINVAL \
Mauro Carvalho Chehab6d172492011-07-05 10:07:37 -0300123 EIO \
124 EMFILE \
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -0300125 ENFILE \
Mauro Carvalho Chehab6d172492011-07-05 10:07:37 -0300126 ENOBUFS \
127 ENODATA \
128 ENODEV \
129 ENOENT \
130 ENOIOCTLCMD \
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -0300131 ENOMEM \
132 ENOSPC \
Mauro Carvalho Chehab6d172492011-07-05 10:07:37 -0300133 ENOSR \
134 ENOSYS \
135 ENOTSUP \
136 ENOTSUPP \
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -0300137 ENOTTY \
138 ENXIO \
Mauro Carvalho Chehab6d172492011-07-05 10:07:37 -0300139 EOPNOTSUPP \
140 EOVERFLOW \
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -0300141 EPERM \
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -0300142 EPIPE \
Mauro Carvalho Chehab6d172492011-07-05 10:07:37 -0300143 EPROTO \
144 ERANGE \
145 EREMOTE \
146 EREMOTEIO \
147 ERESTART \
148 ERESTARTSYS \
149 ESHUTDOWN \
150 ESPIPE \
151 ETIME \
152 ETIMEDOUT \
153 EUSERS \
154 EWOULDBLOCK \
155 EXDEV \
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -0300156
157ESCAPE = \
158 -e "s/&/\\&/g" \
159 -e "s/</\\&lt;/g" \
160 -e "s/>/\\&gt;/g"
161
162FILENAME = \
163 -e s,"^[^\/]*/",, \
164 -e s/"\\.xml"// \
165 -e s/"\\.tmpl"// \
166 -e s/\\\./-/g \
167 -e s/"^func-"// \
168 -e s/"^pixfmt-"// \
169 -e s/"^vidioc-"//
170
171# Generate references to these structs in videodev2.h.xml.
172DOCUMENTED = \
173 -e "s/\(enum *\)v4l2_mpeg_cx2341x_video_\([a-z]*_spatial_filter_type\)/\1<link linkend=\"\2\">v4l2_mpeg_cx2341x_video_\2<\/link>/g" \
174 -e "s/\(\(enum\|struct\) *\)\(v4l2_[a-zA-Z0-9_]*\)/\1<link linkend=\"\3\">\3<\/link>/g" \
175 -e "s/\(V4L2_PIX_FMT_[A-Z0-9_]\+\) /<link linkend=\"\1\">\1<\/link> /g" \
176 -e ":a;s/\(linkend=\".*\)_\(.*\">\)/\1-\2/;ta" \
177 -e "s/v4l2\-mpeg\-vbi\-ITV0/v4l2-mpeg-vbi-itv0-1/g"
178
179DVB_DOCUMENTED = \
Mauro Carvalho Chehab98a2b602011-06-07 14:51:56 -0300180 -e "s/\(linkend\=\"\)FE_SET_PROPERTY/\1FE_GET_PROPERTY/g" \
181 -e "s,\(struct\s\+\)\([a-z0-9_]\+\)\(\s\+{\),\1\<link linkend=\"\2\">\2\<\/link\>\3,g" \
182 -e "s,\(}\s\+\)\([a-z0-9_]\+_t\+\),\1\<link linkend=\"\2\">\2\<\/link\>,g" \
Mauro Carvalho Chehab95e61e02011-06-07 16:58:00 -0300183 -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 -0300184 -e "s,<link\s\+linkend=\".*\">\(DTV_IOCTL_MAX_MSGS\|dtv_cmds_h\|__.*_old\)<\/link>,\1,g" \
Mauro Carvalho Chehabd5dc2de2011-06-07 16:17:00 -0300185 -e ":a;s/\(linkend=\".*\)_\(.*\">\)/\1-\2/;ta" \
Mauro Carvalho Chehabdc05e572011-06-08 15:39:05 -0300186 -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 -0300187 -e "s,DTV-ISDBT-LAYER[A-C],DTV-ISDBT-LAYER,g" \
Mauro Carvalho Chehab6cb77a82011-06-07 17:58:59 -0300188 -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 -0300189 -e "s,<link\s\+linkend=\".*\">\(__.*_OLD\)<\/link>,\1,g" \
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -0300190
191#
192# Media targets and dependencies
193#
194
Mauro Carvalho Chehabbd7319d2011-06-15 23:13:19 -0300195install_media_images = \
196 $(Q)cp $(OBJIMGFILES) $(MEDIA_OBJ_DIR)/media_api
197
198$(MEDIA_OBJ_DIR)/%: $(MEDIA_SRC_DIR)/%.b64
199 $(Q)base64 -d $< >$@
200
201$(MEDIA_OBJ_DIR)/v4l2.xml: $(OBJIMGFILES)
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -0300202 @$($(quiet)gen_xml)
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -0300203 @(ln -sf $(MEDIA_SRC_DIR)/v4l/*xml $(MEDIA_OBJ_DIR)/)
204 @(ln -sf $(MEDIA_SRC_DIR)/dvb/*xml $(MEDIA_OBJ_DIR)/)
205
206$(MEDIA_OBJ_DIR)/videodev2.h.xml: $(srctree)/include/linux/videodev2.h $(MEDIA_OBJ_DIR)/v4l2.xml
207 @$($(quiet)gen_xml)
208 @( \
209 echo "<programlisting>") > $@
210 @( \
211 expand --tabs=8 < $< | \
212 sed $(ESCAPE) $(DOCUMENTED) | \
213 sed 's/i\.e\./&ie;/') >> $@
214 @( \
215 echo "</programlisting>") >> $@
216
Mauro Carvalho Chehabd9d73412011-06-08 10:23:34 -0300217$(MEDIA_OBJ_DIR)/audio.h.xml: $(srctree)/include/linux/dvb/audio.h $(MEDIA_OBJ_DIR)/v4l2.xml
218 @$($(quiet)gen_xml)
219 @( \
220 echo "<programlisting>") > $@
221 @( \
222 expand --tabs=8 < $< | \
223 sed $(ESCAPE) $(DVB_DOCUMENTED) | \
224 sed 's/i\.e\./&ie;/') >> $@
225 @( \
226 echo "</programlisting>") >> $@
227
228$(MEDIA_OBJ_DIR)/ca.h.xml: $(srctree)/include/linux/dvb/ca.h $(MEDIA_OBJ_DIR)/v4l2.xml
229 @$($(quiet)gen_xml)
230 @( \
231 echo "<programlisting>") > $@
232 @( \
233 expand --tabs=8 < $< | \
234 sed $(ESCAPE) $(DVB_DOCUMENTED) | \
235 sed 's/i\.e\./&ie;/') >> $@
236 @( \
237 echo "</programlisting>") >> $@
238
239$(MEDIA_OBJ_DIR)/dmx.h.xml: $(srctree)/include/linux/dvb/dmx.h $(MEDIA_OBJ_DIR)/v4l2.xml
240 @$($(quiet)gen_xml)
241 @( \
242 echo "<programlisting>") > $@
243 @( \
244 expand --tabs=8 < $< | \
245 sed $(ESCAPE) $(DVB_DOCUMENTED) | \
246 sed 's/i\.e\./&ie;/') >> $@
247 @( \
248 echo "</programlisting>") >> $@
249
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -0300250$(MEDIA_OBJ_DIR)/frontend.h.xml: $(srctree)/include/linux/dvb/frontend.h $(MEDIA_OBJ_DIR)/v4l2.xml
251 @$($(quiet)gen_xml)
252 @( \
253 echo "<programlisting>") > $@
254 @( \
255 expand --tabs=8 < $< | \
256 sed $(ESCAPE) $(DVB_DOCUMENTED) | \
257 sed 's/i\.e\./&ie;/') >> $@
258 @( \
259 echo "</programlisting>") >> $@
260
Mauro Carvalho Chehabd9d73412011-06-08 10:23:34 -0300261$(MEDIA_OBJ_DIR)/net.h.xml: $(srctree)/include/linux/dvb/net.h $(MEDIA_OBJ_DIR)/v4l2.xml
262 @$($(quiet)gen_xml)
263 @( \
264 echo "<programlisting>") > $@
265 @( \
266 expand --tabs=8 < $< | \
267 sed $(ESCAPE) $(DVB_DOCUMENTED) | \
268 sed 's/i\.e\./&ie;/') >> $@
269 @( \
270 echo "</programlisting>") >> $@
271
Mauro Carvalho Chehabd9d73412011-06-08 10:23:34 -0300272$(MEDIA_OBJ_DIR)/video.h.xml: $(srctree)/include/linux/dvb/video.h $(MEDIA_OBJ_DIR)/v4l2.xml
273 @$($(quiet)gen_xml)
274 @( \
275 echo "<programlisting>") > $@
276 @( \
277 expand --tabs=8 < $< | \
278 sed $(ESCAPE) $(DVB_DOCUMENTED) | \
279 sed 's/i\.e\./&ie;/') >> $@
280 @( \
281 echo "</programlisting>") >> $@
282
Mauro Carvalho Chehab42661292011-05-31 16:27:44 -0300283$(MEDIA_OBJ_DIR)/media-entities.tmpl: $(MEDIA_OBJ_DIR)/v4l2.xml
284 @$($(quiet)gen_xml)
285 @( \
286 echo "<!-- Generated file! Do not edit. -->") >$@
287 @( \
288 echo -e "\n<!-- Functions -->") >>$@
289 @( \
290 for ident in $(FUNCS) ; do \
291 entity=`echo $$ident | tr _ -` ; \
292 echo "<!ENTITY func-$$entity \"<link" \
293 "linkend='func-$$entity'><function>$$ident()</function></link>\">" \
294 >>$@ ; \
295 done)
296 @( \
297 echo -e "\n<!-- Ioctls -->") >>$@
298 @( \
299 for ident in $(IOCTLS) ; do \
300 entity=`echo $$ident | tr _ -` ; \
301 id=`grep "<refname>$$ident" $(MEDIA_OBJ_DIR)/vidioc-*.xml | sed -r s,"^.*/(.*).xml.*","\1",` ; \
302 echo "<!ENTITY $$entity \"<link" \
303 "linkend='$$id'><constant>$$ident</constant></link>\">" \
304 >>$@ ; \
305 done)
306 @( \
307 echo -e "\n<!-- Types -->") >>$@
308 @( \
309 for ident in $(TYPES) ; do \
310 entity=`echo $$ident | tr _ -` ; \
311 echo "<!ENTITY $$entity \"<link" \
312 "linkend='$$entity'>$$ident</link>\">" >>$@ ; \
313 done)
314 @( \
315 echo -e "\n<!-- Enums -->") >>$@
316 @( \
317 for ident in $(ENUMS) ; do \
318 entity=`echo $$ident | sed -e "s/v4l2_mpeg_cx2341x_video_\([a-z]*_spatial_filter_type\)/\1/" | tr _ -` ; \
319 echo "<!ENTITY $$entity \"enum&nbsp;<link" \
320 "linkend='$$entity'>$$ident</link>\">" >>$@ ; \
321 done)
322 @( \
323 echo -e "\n<!-- Structures -->") >>$@
324 @( \
325 for ident in $(STRUCTS) ; do \
326 entity=`echo $$ident | tr _ - | sed s/v4l2-mpeg-vbi-ITV0/v4l2-mpeg-vbi-itv0-1/g` ; \
327 echo "<!ENTITY $$entity \"struct&nbsp;<link" \
328 "linkend='$$entity'>$$ident</link>\">" >>$@ ; \
329 done)
330 @( \
331 echo -e "\n<!-- Error Codes -->") >>$@
332 @( \
333 for ident in $(ERRORS) ; do \
334 echo "<!ENTITY $$ident \"<errorcode>$$ident</errorcode>" \
335 "error code\">" >>$@ ; \
336 done)
337 @( \
338 echo -e "\n<!-- Subsections -->") >>$@
339 @( \
340 for file in $(MEDIA_SGMLS) ; do \
341 entity=`echo "$$file" | sed $(FILENAME) -e s/"^([^-]*)"/sub\1/` ; \
342 if ! echo "$$file" | \
343 grep -q -E -e '^(func|vidioc|pixfmt)-' ; then \
344 echo "<!ENTITY sub-$$entity SYSTEM \"$$file\">" >>$@ ; \
345 fi ; \
346 done)
347 @( \
348 echo -e "\n<!-- Function Reference -->") >>$@
349 @( \
350 for file in $(MEDIA_SGMLS) ; do \
351 if echo "$$file" | \
352 grep -q -E -e '(func|vidioc|pixfmt)-' ; then \
353 entity=`echo "$$file" |sed $(FILENAME)` ; \
354 echo "<!ENTITY $$entity SYSTEM \"$$file\">" >>$@ ; \
355 fi ; \
356 done)
357
358# Jade can auto-generate a list-of-tables, which includes all structs,
359# but we only want data types, all types, and sorted please.
360$(MEDIA_OBJ_DIR)/media-indices.tmpl: $(MEDIA_OBJ_DIR)/v4l2.xml
361 @$($(quiet)gen_xml)
362 @( \
363 echo "<!-- Generated file! Do not edit. -->") >$@
364 @( \
365 echo -e "\n<index><title>List of Types</title>") >>$@
366 @( \
367 for ident in $(TYPES) ; do \
368 id=`echo $$ident | tr _ -` ; \
369 echo "<indexentry><primaryie><link" \
370 "linkend='$$id'>$$ident</link></primaryie></indexentry>" >>$@ ; \
371 done)
372 @( \
373 for ident in $(ENUMS) ; do \
374 id=`echo $$ident | sed -e "s/v4l2_mpeg_cx2341x_video_\([a-z]*_spatial_filter_type\)/\1/" | tr _ -`; \
375 echo "<indexentry><primaryie>enum&nbsp;<link" \
376 "linkend='$$id'>$$ident</link></primaryie></indexentry>" >>$@ ; \
377 done)
378 @( \
379 for ident in $(STRUCTS) ; do \
380 id=`echo $$ident | tr _ - | sed s/v4l2-mpeg-vbi-ITV0/v4l2-mpeg-vbi-itv0-1/g` ; \
381 echo "<indexentry><primaryie>struct&nbsp;<link" \
382 "linkend='$$id'>$$ident</link></primaryie></indexentry>" >>$@ ; \
383 done)
384 @( \
385 echo "</index>") >>$@
386