Mauro Carvalho Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 1 | ### |
| 2 | # Media build rules - Auto-generates media contents/indexes and *.h xml's |
| 3 | # |
| 4 | |
| 5 | SHELL=/bin/bash |
| 6 | |
| 7 | MEDIA_OBJ_DIR=$(objtree)/Documentation/DocBook/ |
| 8 | MEDIA_SRC_DIR=$(srctree)/Documentation/DocBook/media |
| 9 | |
| 10 | MEDIA_TEMP = media-entities.tmpl \ |
| 11 | media-indices.tmpl \ |
| 12 | videodev2.h.xml \ |
| 13 | v4l2.xml \ |
Mauro Carvalho Chehab | d9d7341 | 2011-06-08 10:23:34 -0300 | [diff] [blame] | 14 | audio.h.xml \ |
| 15 | ca.h.xml \ |
| 16 | dmx.h.xml \ |
| 17 | frontend.h.xml \ |
| 18 | net.h.xml \ |
Mauro Carvalho Chehab | d9d7341 | 2011-06-08 10:23:34 -0300 | [diff] [blame] | 19 | video.h.xml \ |
Mauro Carvalho Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 20 | |
Mauro Carvalho Chehab | bd7319d | 2011-06-15 23:13:19 -0300 | [diff] [blame] | 21 | IMGFILES := $(patsubst %.b64,%, $(notdir $(shell ls $(MEDIA_SRC_DIR)/*.b64))) |
| 22 | OBJIMGFILES := $(addprefix $(MEDIA_OBJ_DIR)/, $(IMGFILES)) |
Mauro Carvalho Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 23 | GENFILES := $(addprefix $(MEDIA_OBJ_DIR)/, $(MEDIA_TEMP)) |
| 24 | |
Mauro Carvalho Chehab | a012fb2 | 2011-06-09 16:34:29 -0300 | [diff] [blame] | 25 | PHONY += cleanmediadocs |
Mauro Carvalho Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 26 | |
| 27 | cleanmediadocs: |
Takashi Iwai | 0684d84 | 2014-10-21 18:18:12 +0200 | [diff] [blame] | 28 | -@rm -f `find $(MEDIA_OBJ_DIR) -type l` $(GENFILES) $(OBJIMGFILES) 2>/dev/null |
Mauro Carvalho Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 29 | |
| 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 | |
| 36 | V4L_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 | |
| 42 | DVB_SGMLS = \ |
| 43 | $(shell ls $(MEDIA_SRC_DIR)/dvb/*.xml|perl -ne 'print "$$1 " if (m,.*/(.*)\n,)') |
| 44 | |
| 45 | MEDIA_SGMLS = $(addprefix ./,$(V4L_SGMLS)) $(addprefix ./,$(DVB_SGMLS)) $(addprefix ./,$(MEDIA_TEMP)) |
| 46 | |
| 47 | FUNCS = \ |
| 48 | close \ |
| 49 | ioctl \ |
| 50 | mmap \ |
| 51 | munmap \ |
| 52 | open \ |
| 53 | poll \ |
| 54 | read \ |
| 55 | select \ |
| 56 | write \ |
| 57 | |
| 58 | IOCTLS = \ |
Mauro Carvalho Chehab | ce3b595 | 2012-10-17 10:05:09 -0300 | [diff] [blame] | 59 | $(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 Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 68 | |
Mauro Carvalho Chehab | c569eb7 | 2015-05-26 11:35:44 -0300 | [diff] [blame] | 69 | DEFINES = \ |
| 70 | $(shell perl -ne 'print "$$1 " if /\#define\s+(DTV_[^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/frontend.h) \ |
| 71 | |
Mauro Carvalho Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 72 | TYPES = \ |
Mauro Carvalho Chehab | edcf3cd | 2015-05-28 20:09:45 -0300 | [diff] [blame] | 73 | $(shell perl -ne 'print "$$1 " if /^typedef\s+.*\s+(\S+)\;/' $(srctree)/include/uapi/linux/videodev2.h) \ |
| 74 | $(shell perl -ne 'print "$$1 " if /^typedef\s+.*\s+(\S+)\;/' $(srctree)/include/uapi/linux/dvb/frontend.h) |
Mauro Carvalho Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 75 | |
| 76 | ENUMS = \ |
Mauro Carvalho Chehab | 2695e66 | 2015-06-07 05:21:51 -0300 | [diff] [blame] | 77 | $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' \ |
| 78 | $(srctree)/include/uapi/linux/videodev2.h \ |
| 79 | $(srctree)/include/uapi/linux/dvb/audio.h \ |
| 80 | $(srctree)/include/uapi/linux/dvb/ca.h \ |
| 81 | $(srctree)/include/uapi/linux/dvb/dmx.h \ |
| 82 | $(srctree)/include/uapi/linux/dvb/frontend.h \ |
| 83 | $(srctree)/include/uapi/linux/dvb/net.h \ |
| 84 | $(srctree)/include/uapi/linux/dvb/video.h \ |
| 85 | $(srctree)/include/uapi/linux/media.h \ |
| 86 | $(srctree)/include/uapi/linux/v4l2-mediabus.h \ |
| 87 | $(srctree)/include/uapi/linux/v4l2-subdev.h) |
| 88 | |
| 89 | ENUM_DEFS = \ |
Mauro Carvalho Chehab | 429c202 | 2015-06-07 16:17:56 -0300 | [diff] [blame] | 90 | $(shell perl -e 'open IN,"cat @ARGV| cpp -fpreprocessed |"; while (<IN>) { if ($$enum) {print "$$1\n" if (/\s*([A-Z]\S+)\b/); } $$enum = 0 if ($$enum && /^\}/); $$enum = 1 if(/^\s*enum\s/); }; close IN;' \ |
Mauro Carvalho Chehab | 2695e66 | 2015-06-07 05:21:51 -0300 | [diff] [blame] | 91 | $(srctree)/include/uapi/linux/dvb/dmx.h \ |
Mauro Carvalho Chehab | 6eab804 | 2015-06-07 19:29:43 -0300 | [diff] [blame] | 92 | $(srctree)/include/uapi/linux/dvb/frontend.h) |
Mauro Carvalho Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 93 | |
| 94 | STRUCTS = \ |
Mauro Carvalho Chehab | ce3b595 | 2012-10-17 10:05:09 -0300 | [diff] [blame] | 95 | $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/videodev2.h) \ |
| 96 | $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s\{]+)\s*/)' $(srctree)/include/uapi/linux/dvb/audio.h) \ |
| 97 | $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/)' $(srctree)/include/uapi/linux/dvb/ca.h) \ |
| 98 | $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/)' $(srctree)/include/uapi/linux/dvb/dmx.h) \ |
| 99 | $(shell perl -ne 'print "$$1 " if (!/dtv\_cmds\_h/ && /^struct\s+([^\s]+)\s+/)' $(srctree)/include/uapi/linux/dvb/frontend.h) \ |
Mauro Carvalho Chehab | 315d27a | 2015-06-01 08:56:49 -0300 | [diff] [blame] | 100 | $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/ && !/_old/)' $(srctree)/include/uapi/linux/dvb/net.h) \ |
Mauro Carvalho Chehab | ce3b595 | 2012-10-17 10:05:09 -0300 | [diff] [blame] | 101 | $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/)' $(srctree)/include/uapi/linux/dvb/video.h) \ |
| 102 | $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/media.h) \ |
| 103 | $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/v4l2-subdev.h) \ |
| 104 | $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/v4l2-mediabus.h) |
Mauro Carvalho Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 105 | |
| 106 | ERRORS = \ |
Mauro Carvalho Chehab | 6d17249 | 2011-07-05 10:07:37 -0300 | [diff] [blame] | 107 | E2BIG \ |
Mauro Carvalho Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 108 | EACCES \ |
| 109 | EAGAIN \ |
| 110 | EBADF \ |
Mauro Carvalho Chehab | 6d17249 | 2011-07-05 10:07:37 -0300 | [diff] [blame] | 111 | EBADFD \ |
| 112 | EBADR \ |
| 113 | EBADRQC \ |
Mauro Carvalho Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 114 | EBUSY \ |
Mauro Carvalho Chehab | 6d17249 | 2011-07-05 10:07:37 -0300 | [diff] [blame] | 115 | ECHILD \ |
| 116 | ECONNRESET \ |
| 117 | EDEADLK \ |
| 118 | EDOM \ |
| 119 | EEXIST \ |
Mauro Carvalho Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 120 | EFAULT \ |
Mauro Carvalho Chehab | 6d17249 | 2011-07-05 10:07:37 -0300 | [diff] [blame] | 121 | EFBIG \ |
| 122 | EILSEQ \ |
| 123 | EINIT \ |
| 124 | EINPROGRESS \ |
Mauro Carvalho Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 125 | EINTR \ |
| 126 | EINVAL \ |
Mauro Carvalho Chehab | 6d17249 | 2011-07-05 10:07:37 -0300 | [diff] [blame] | 127 | EIO \ |
| 128 | EMFILE \ |
Mauro Carvalho Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 129 | ENFILE \ |
Mauro Carvalho Chehab | 6d17249 | 2011-07-05 10:07:37 -0300 | [diff] [blame] | 130 | ENOBUFS \ |
| 131 | ENODATA \ |
| 132 | ENODEV \ |
| 133 | ENOENT \ |
| 134 | ENOIOCTLCMD \ |
Mauro Carvalho Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 135 | ENOMEM \ |
| 136 | ENOSPC \ |
Mauro Carvalho Chehab | 6d17249 | 2011-07-05 10:07:37 -0300 | [diff] [blame] | 137 | ENOSR \ |
| 138 | ENOSYS \ |
| 139 | ENOTSUP \ |
| 140 | ENOTSUPP \ |
Mauro Carvalho Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 141 | ENOTTY \ |
| 142 | ENXIO \ |
Mauro Carvalho Chehab | 6d17249 | 2011-07-05 10:07:37 -0300 | [diff] [blame] | 143 | EOPNOTSUPP \ |
| 144 | EOVERFLOW \ |
Mauro Carvalho Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 145 | EPERM \ |
Mauro Carvalho Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 146 | EPIPE \ |
Mauro Carvalho Chehab | 6d17249 | 2011-07-05 10:07:37 -0300 | [diff] [blame] | 147 | EPROTO \ |
| 148 | ERANGE \ |
| 149 | EREMOTE \ |
| 150 | EREMOTEIO \ |
| 151 | ERESTART \ |
| 152 | ERESTARTSYS \ |
| 153 | ESHUTDOWN \ |
| 154 | ESPIPE \ |
| 155 | ETIME \ |
| 156 | ETIMEDOUT \ |
| 157 | EUSERS \ |
| 158 | EWOULDBLOCK \ |
| 159 | EXDEV \ |
Mauro Carvalho Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 160 | |
| 161 | ESCAPE = \ |
| 162 | -e "s/&/\\&/g" \ |
| 163 | -e "s/</\\</g" \ |
| 164 | -e "s/>/\\>/g" |
| 165 | |
| 166 | FILENAME = \ |
| 167 | -e s,"^[^\/]*/",, \ |
| 168 | -e s/"\\.xml"// \ |
| 169 | -e s/"\\.tmpl"// \ |
| 170 | -e s/\\\./-/g \ |
| 171 | -e s/"^func-"// \ |
| 172 | -e s/"^pixfmt-"// \ |
| 173 | -e s/"^vidioc-"// |
| 174 | |
| 175 | # Generate references to these structs in videodev2.h.xml. |
| 176 | DOCUMENTED = \ |
| 177 | -e "s/\(enum *\)v4l2_mpeg_cx2341x_video_\([a-z]*_spatial_filter_type\)/\1<link linkend=\"\2\">v4l2_mpeg_cx2341x_video_\2<\/link>/g" \ |
| 178 | -e "s/\(\(enum\|struct\) *\)\(v4l2_[a-zA-Z0-9_]*\)/\1<link linkend=\"\3\">\3<\/link>/g" \ |
Laurent Pinchart | d52e238 | 2014-05-27 09:41:05 -0300 | [diff] [blame] | 179 | -e "s/\(V4L2_PIX_FMT_[A-Z0-9_]\+\)\(\s\+v4l2_fourcc\)/<link linkend=\"\1\">\1<\/link>\2/g" \ |
Mauro Carvalho Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 180 | -e ":a;s/\(linkend=\".*\)_\(.*\">\)/\1-\2/;ta" \ |
| 181 | -e "s/v4l2\-mpeg\-vbi\-ITV0/v4l2-mpeg-vbi-itv0-1/g" |
| 182 | |
| 183 | DVB_DOCUMENTED = \ |
Mauro Carvalho Chehab | 98a2b60 | 2011-06-07 14:51:56 -0300 | [diff] [blame] | 184 | -e "s,\(struct\s\+\)\([a-z0-9_]\+\)\(\s\+{\),\1\<link linkend=\"\2\">\2\<\/link\>\3,g" \ |
| 185 | -e "s,\(}\s\+\)\([a-z0-9_]\+_t\+\),\1\<link linkend=\"\2\">\2\<\/link\>,g" \ |
Mauro Carvalho Chehab | 95e61e0 | 2011-06-07 16:58:00 -0300 | [diff] [blame] | 186 | -e "s,\(define\s\+\)\(DTV_[A-Z0-9_]\+\)\(\s\+[0-9]\+\),\1\<link linkend=\"\2\">\2\<\/link\>\3,g" \ |
Mauro Carvalho Chehab | ca5b233 | 2011-06-08 15:08:57 -0300 | [diff] [blame] | 187 | -e "s,<link\s\+linkend=\".*\">\(DTV_IOCTL_MAX_MSGS\|dtv_cmds_h\|__.*_old\)<\/link>,\1,g" \ |
Mauro Carvalho Chehab | d5dc2de | 2011-06-07 16:17:00 -0300 | [diff] [blame] | 188 | -e ":a;s/\(linkend=\".*\)_\(.*\">\)/\1-\2/;ta" \ |
Mauro Carvalho Chehab | dc05e57 | 2011-06-08 15:39:05 -0300 | [diff] [blame] | 189 | -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 Chehab | 95e61e0 | 2011-06-07 16:58:00 -0300 | [diff] [blame] | 190 | -e "s,DTV-ISDBT-LAYER[A-C],DTV-ISDBT-LAYER,g" \ |
Mauro Carvalho Chehab | 6cb77a8 | 2011-06-07 17:58:59 -0300 | [diff] [blame] | 191 | -e "s,\(define\s\+\)\([A-Z0-9_]\+\)\(\s\+_IO\),\1\<link linkend=\"\2\">\2\<\/link\>\3,g" \ |
Mauro Carvalho Chehab | c569eb7 | 2015-05-26 11:35:44 -0300 | [diff] [blame] | 192 | -e "s,\(define\s\+\)\(DTV_[A-Z0-9_]\+\)\(\s\+\),\1\<link linkend=\"\2\">\2\<\/link\>\3,g" \ |
Mauro Carvalho Chehab | ca5b233 | 2011-06-08 15:08:57 -0300 | [diff] [blame] | 193 | -e "s,<link\s\+linkend=\".*\">\(__.*_OLD\)<\/link>,\1,g" \ |
Mauro Carvalho Chehab | 277dfcb | 2015-05-26 10:28:05 -0300 | [diff] [blame] | 194 | -e "s/\(linkend\=\"\)FE_SET_PROPERTY/\1FE_GET_PROPERTY/g" \ |
Mauro Carvalho Chehab | c569eb7 | 2015-05-26 11:35:44 -0300 | [diff] [blame] | 195 | -e "s,<link\s\+linkend=\".*\">\(DTV_ISDBS_TS_ID_LEGACY\|DTV_MAX_COMMAND\|DTV_IOCTL_MAX_MSGS\)<\/link>,\1,g" \ |
Mauro Carvalho Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 196 | |
| 197 | # |
| 198 | # Media targets and dependencies |
| 199 | # |
| 200 | |
Mauro Carvalho Chehab | bd7319d | 2011-06-15 23:13:19 -0300 | [diff] [blame] | 201 | install_media_images = \ |
Mauro Carvalho Chehab | a1ef3ee | 2015-05-25 13:40:28 -0300 | [diff] [blame] | 202 | $(Q)-cp $(OBJIMGFILES) $(MEDIA_SRC_DIR)/*.svg $(MEDIA_SRC_DIR)/v4l/*.svg $(MEDIA_OBJ_DIR)/media_api |
Mauro Carvalho Chehab | bd7319d | 2011-06-15 23:13:19 -0300 | [diff] [blame] | 203 | |
| 204 | $(MEDIA_OBJ_DIR)/%: $(MEDIA_SRC_DIR)/%.b64 |
| 205 | $(Q)base64 -d $< >$@ |
| 206 | |
| 207 | $(MEDIA_OBJ_DIR)/v4l2.xml: $(OBJIMGFILES) |
Mauro Carvalho Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 208 | @$($(quiet)gen_xml) |
Michal Marek | a981296 | 2014-06-18 17:15:17 +0200 | [diff] [blame] | 209 | @(ln -sf `cd $(MEDIA_SRC_DIR) && /bin/pwd`/v4l/*xml $(MEDIA_OBJ_DIR)/) |
| 210 | @(ln -sf `cd $(MEDIA_SRC_DIR) && /bin/pwd`/dvb/*xml $(MEDIA_OBJ_DIR)/) |
Mauro Carvalho Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 211 | |
Mauro Carvalho Chehab | ce3b595 | 2012-10-17 10:05:09 -0300 | [diff] [blame] | 212 | $(MEDIA_OBJ_DIR)/videodev2.h.xml: $(srctree)/include/uapi/linux/videodev2.h $(MEDIA_OBJ_DIR)/v4l2.xml |
Mauro Carvalho Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 213 | @$($(quiet)gen_xml) |
| 214 | @( \ |
| 215 | echo "<programlisting>") > $@ |
| 216 | @( \ |
| 217 | expand --tabs=8 < $< | \ |
| 218 | sed $(ESCAPE) $(DOCUMENTED) | \ |
| 219 | sed 's/i\.e\./&ie;/') >> $@ |
| 220 | @( \ |
| 221 | echo "</programlisting>") >> $@ |
| 222 | |
Mauro Carvalho Chehab | ce3b595 | 2012-10-17 10:05:09 -0300 | [diff] [blame] | 223 | $(MEDIA_OBJ_DIR)/audio.h.xml: $(srctree)/include/uapi/linux/dvb/audio.h $(MEDIA_OBJ_DIR)/v4l2.xml |
Mauro Carvalho Chehab | d9d7341 | 2011-06-08 10:23:34 -0300 | [diff] [blame] | 224 | @$($(quiet)gen_xml) |
| 225 | @( \ |
| 226 | echo "<programlisting>") > $@ |
| 227 | @( \ |
| 228 | expand --tabs=8 < $< | \ |
| 229 | sed $(ESCAPE) $(DVB_DOCUMENTED) | \ |
| 230 | sed 's/i\.e\./&ie;/') >> $@ |
| 231 | @( \ |
| 232 | echo "</programlisting>") >> $@ |
| 233 | |
Mauro Carvalho Chehab | ce3b595 | 2012-10-17 10:05:09 -0300 | [diff] [blame] | 234 | $(MEDIA_OBJ_DIR)/ca.h.xml: $(srctree)/include/uapi/linux/dvb/ca.h $(MEDIA_OBJ_DIR)/v4l2.xml |
Mauro Carvalho Chehab | d9d7341 | 2011-06-08 10:23:34 -0300 | [diff] [blame] | 235 | @$($(quiet)gen_xml) |
| 236 | @( \ |
| 237 | echo "<programlisting>") > $@ |
| 238 | @( \ |
| 239 | expand --tabs=8 < $< | \ |
| 240 | sed $(ESCAPE) $(DVB_DOCUMENTED) | \ |
| 241 | sed 's/i\.e\./&ie;/') >> $@ |
| 242 | @( \ |
| 243 | echo "</programlisting>") >> $@ |
| 244 | |
Mauro Carvalho Chehab | ce3b595 | 2012-10-17 10:05:09 -0300 | [diff] [blame] | 245 | $(MEDIA_OBJ_DIR)/dmx.h.xml: $(srctree)/include/uapi/linux/dvb/dmx.h $(MEDIA_OBJ_DIR)/v4l2.xml |
Mauro Carvalho Chehab | d9d7341 | 2011-06-08 10:23:34 -0300 | [diff] [blame] | 246 | @$($(quiet)gen_xml) |
| 247 | @( \ |
| 248 | echo "<programlisting>") > $@ |
| 249 | @( \ |
Mauro Carvalho Chehab | 6eab804 | 2015-06-07 19:29:43 -0300 | [diff] [blame] | 250 | for ident in $(ENUM_DEFS) ; do \ |
| 251 | entity=`echo $$ident | tr _ -` ; \ |
| 252 | r="$$r s/([^\w\-])$$ident([^\w\-])/\1\&$$entity\;\2/g;";\ |
| 253 | done; \ |
Mauro Carvalho Chehab | d9d7341 | 2011-06-08 10:23:34 -0300 | [diff] [blame] | 254 | expand --tabs=8 < $< | \ |
| 255 | sed $(ESCAPE) $(DVB_DOCUMENTED) | \ |
Mauro Carvalho Chehab | 6eab804 | 2015-06-07 19:29:43 -0300 | [diff] [blame] | 256 | sed 's/i\.e\./&ie;/' | \ |
| 257 | perl -ne "$$r print $$_;") >> $@ |
Mauro Carvalho Chehab | d9d7341 | 2011-06-08 10:23:34 -0300 | [diff] [blame] | 258 | @( \ |
| 259 | echo "</programlisting>") >> $@ |
| 260 | |
Mauro Carvalho Chehab | ce3b595 | 2012-10-17 10:05:09 -0300 | [diff] [blame] | 261 | $(MEDIA_OBJ_DIR)/frontend.h.xml: $(srctree)/include/uapi/linux/dvb/frontend.h $(MEDIA_OBJ_DIR)/v4l2.xml |
Mauro Carvalho Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 262 | @$($(quiet)gen_xml) |
| 263 | @( \ |
| 264 | echo "<programlisting>") > $@ |
| 265 | @( \ |
Mauro Carvalho Chehab | 2695e66 | 2015-06-07 05:21:51 -0300 | [diff] [blame] | 266 | for ident in $(ENUM_DEFS) ; do \ |
| 267 | entity=`echo $$ident | tr _ -` ; \ |
| 268 | r="$$r s/([^\w\-])$$ident([^\w\-])/\1\&$$entity\;\2/g;";\ |
| 269 | done; \ |
Mauro Carvalho Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 270 | expand --tabs=8 < $< | \ |
| 271 | sed $(ESCAPE) $(DVB_DOCUMENTED) | \ |
Mauro Carvalho Chehab | 2695e66 | 2015-06-07 05:21:51 -0300 | [diff] [blame] | 272 | sed 's/i\.e\./&ie;/' | \ |
| 273 | perl -ne "$$r print $$_;") >> $@ |
Mauro Carvalho Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 274 | @( \ |
| 275 | echo "</programlisting>") >> $@ |
| 276 | |
Mauro Carvalho Chehab | ce3b595 | 2012-10-17 10:05:09 -0300 | [diff] [blame] | 277 | $(MEDIA_OBJ_DIR)/net.h.xml: $(srctree)/include/uapi/linux/dvb/net.h $(MEDIA_OBJ_DIR)/v4l2.xml |
Mauro Carvalho Chehab | d9d7341 | 2011-06-08 10:23:34 -0300 | [diff] [blame] | 278 | @$($(quiet)gen_xml) |
| 279 | @( \ |
| 280 | echo "<programlisting>") > $@ |
| 281 | @( \ |
| 282 | expand --tabs=8 < $< | \ |
| 283 | sed $(ESCAPE) $(DVB_DOCUMENTED) | \ |
| 284 | sed 's/i\.e\./&ie;/') >> $@ |
| 285 | @( \ |
| 286 | echo "</programlisting>") >> $@ |
| 287 | |
Mauro Carvalho Chehab | ce3b595 | 2012-10-17 10:05:09 -0300 | [diff] [blame] | 288 | $(MEDIA_OBJ_DIR)/video.h.xml: $(srctree)/include/uapi/linux/dvb/video.h $(MEDIA_OBJ_DIR)/v4l2.xml |
Mauro Carvalho Chehab | d9d7341 | 2011-06-08 10:23:34 -0300 | [diff] [blame] | 289 | @$($(quiet)gen_xml) |
| 290 | @( \ |
| 291 | echo "<programlisting>") > $@ |
| 292 | @( \ |
| 293 | expand --tabs=8 < $< | \ |
| 294 | sed $(ESCAPE) $(DVB_DOCUMENTED) | \ |
| 295 | sed 's/i\.e\./&ie;/') >> $@ |
| 296 | @( \ |
| 297 | echo "</programlisting>") >> $@ |
| 298 | |
Mauro Carvalho Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 299 | $(MEDIA_OBJ_DIR)/media-entities.tmpl: $(MEDIA_OBJ_DIR)/v4l2.xml |
| 300 | @$($(quiet)gen_xml) |
| 301 | @( \ |
| 302 | echo "<!-- Generated file! Do not edit. -->") >$@ |
| 303 | @( \ |
| 304 | echo -e "\n<!-- Functions -->") >>$@ |
| 305 | @( \ |
| 306 | for ident in $(FUNCS) ; do \ |
| 307 | entity=`echo $$ident | tr _ -` ; \ |
| 308 | echo "<!ENTITY func-$$entity \"<link" \ |
| 309 | "linkend='func-$$entity'><function>$$ident()</function></link>\">" \ |
| 310 | >>$@ ; \ |
| 311 | done) |
| 312 | @( \ |
| 313 | echo -e "\n<!-- Ioctls -->") >>$@ |
| 314 | @( \ |
Mauro Carvalho Chehab | 55d4423 | 2015-05-26 17:29:22 -0300 | [diff] [blame] | 315 | for ident in `echo $(IOCTLS) | sed -e "s,VIDIOC_RESERVED,,"`; do\ |
Mauro Carvalho Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 316 | entity=`echo $$ident | tr _ -` ; \ |
Mauro Carvalho Chehab | 87e4d63 | 2015-05-26 12:42:08 -0300 | [diff] [blame] | 317 | id=`grep -e "<refname>$$ident" -e "<section id=\"$$ident\"" $$(find $(MEDIA_SRC_DIR) -name *.xml -type f)| sed -r s,"^.*/(.*).xml.*","\1",` ; \ |
| 318 | if [ "$$id" != "" ]; then echo "<!ENTITY $$entity \"<link" \ |
Mauro Carvalho Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 319 | "linkend='$$id'><constant>$$ident</constant></link>\">" \ |
Mauro Carvalho Chehab | 87e4d63 | 2015-05-26 12:42:08 -0300 | [diff] [blame] | 320 | >>$@ ; else \ |
| 321 | echo "Warning: undocumented ioctl: $$ident. Please document it at the media DocBook!" >&2; \ |
| 322 | fi; \ |
Mauro Carvalho Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 323 | done) |
| 324 | @( \ |
Mauro Carvalho Chehab | c569eb7 | 2015-05-26 11:35:44 -0300 | [diff] [blame] | 325 | echo -e "\n<!-- Defines -->") >>$@ |
| 326 | @( \ |
| 327 | for ident in $(DEFINES) ; do \ |
| 328 | entity=`echo $$ident | tr _ -` ; \ |
| 329 | echo "<!ENTITY $$entity \"<link" \ |
| 330 | "linkend='$$entity'><constant>$$ident</constant></link>\">" \ |
| 331 | >>$@ ; \ |
| 332 | done) |
| 333 | @( \ |
Mauro Carvalho Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 334 | echo -e "\n<!-- Types -->") >>$@ |
| 335 | @( \ |
| 336 | for ident in $(TYPES) ; do \ |
| 337 | entity=`echo $$ident | tr _ -` ; \ |
| 338 | echo "<!ENTITY $$entity \"<link" \ |
| 339 | "linkend='$$entity'>$$ident</link>\">" >>$@ ; \ |
| 340 | done) |
| 341 | @( \ |
| 342 | echo -e "\n<!-- Enums -->") >>$@ |
| 343 | @( \ |
| 344 | for ident in $(ENUMS) ; do \ |
| 345 | entity=`echo $$ident | sed -e "s/v4l2_mpeg_cx2341x_video_\([a-z]*_spatial_filter_type\)/\1/" | tr _ -` ; \ |
| 346 | echo "<!ENTITY $$entity \"enum <link" \ |
| 347 | "linkend='$$entity'>$$ident</link>\">" >>$@ ; \ |
| 348 | done) |
| 349 | @( \ |
Mauro Carvalho Chehab | 2695e66 | 2015-06-07 05:21:51 -0300 | [diff] [blame] | 350 | echo -e "\n<!-- Enum definitions -->") >>$@ |
| 351 | @( \ |
| 352 | for ident in $(ENUM_DEFS) ; do \ |
| 353 | entity=`echo $$ident | tr _ -` ; \ |
| 354 | echo "<!ENTITY $$entity \"<link" \ |
| 355 | "linkend='$$entity'><constant>$$ident</constant></link>\">" \ |
| 356 | >>$@ ; \ |
| 357 | done) |
| 358 | @( \ |
Mauro Carvalho Chehab | 4266129 | 2011-05-31 16:27:44 -0300 | [diff] [blame] | 359 | echo -e "\n<!-- Structures -->") >>$@ |
| 360 | @( \ |
| 361 | for ident in $(STRUCTS) ; do \ |
| 362 | entity=`echo $$ident | tr _ - | sed s/v4l2-mpeg-vbi-ITV0/v4l2-mpeg-vbi-itv0-1/g` ; \ |
| 363 | echo "<!ENTITY $$entity \"struct <link" \ |
| 364 | "linkend='$$entity'>$$ident</link>\">" >>$@ ; \ |
| 365 | done) |
| 366 | @( \ |
| 367 | echo -e "\n<!-- Error Codes -->") >>$@ |
| 368 | @( \ |
| 369 | for ident in $(ERRORS) ; do \ |
| 370 | echo "<!ENTITY $$ident \"<errorcode>$$ident</errorcode>" \ |
| 371 | "error code\">" >>$@ ; \ |
| 372 | done) |
| 373 | @( \ |
| 374 | echo -e "\n<!-- Subsections -->") >>$@ |
| 375 | @( \ |
| 376 | for file in $(MEDIA_SGMLS) ; do \ |
| 377 | entity=`echo "$$file" | sed $(FILENAME) -e s/"^([^-]*)"/sub\1/` ; \ |
| 378 | if ! echo "$$file" | \ |
| 379 | grep -q -E -e '^(func|vidioc|pixfmt)-' ; then \ |
| 380 | echo "<!ENTITY sub-$$entity SYSTEM \"$$file\">" >>$@ ; \ |
| 381 | fi ; \ |
| 382 | done) |
| 383 | @( \ |
| 384 | echo -e "\n<!-- Function Reference -->") >>$@ |
| 385 | @( \ |
| 386 | for file in $(MEDIA_SGMLS) ; do \ |
| 387 | if echo "$$file" | \ |
| 388 | grep -q -E -e '(func|vidioc|pixfmt)-' ; then \ |
| 389 | entity=`echo "$$file" |sed $(FILENAME)` ; \ |
| 390 | echo "<!ENTITY $$entity SYSTEM \"$$file\">" >>$@ ; \ |
| 391 | fi ; \ |
| 392 | done) |
| 393 | |
| 394 | # Jade can auto-generate a list-of-tables, which includes all structs, |
| 395 | # but we only want data types, all types, and sorted please. |
| 396 | $(MEDIA_OBJ_DIR)/media-indices.tmpl: $(MEDIA_OBJ_DIR)/v4l2.xml |
| 397 | @$($(quiet)gen_xml) |
| 398 | @( \ |
| 399 | echo "<!-- Generated file! Do not edit. -->") >$@ |
| 400 | @( \ |
| 401 | echo -e "\n<index><title>List of Types</title>") >>$@ |
| 402 | @( \ |
| 403 | for ident in $(TYPES) ; do \ |
| 404 | id=`echo $$ident | tr _ -` ; \ |
| 405 | echo "<indexentry><primaryie><link" \ |
| 406 | "linkend='$$id'>$$ident</link></primaryie></indexentry>" >>$@ ; \ |
| 407 | done) |
| 408 | @( \ |
| 409 | for ident in $(ENUMS) ; do \ |
| 410 | id=`echo $$ident | sed -e "s/v4l2_mpeg_cx2341x_video_\([a-z]*_spatial_filter_type\)/\1/" | tr _ -`; \ |
| 411 | echo "<indexentry><primaryie>enum <link" \ |
| 412 | "linkend='$$id'>$$ident</link></primaryie></indexentry>" >>$@ ; \ |
| 413 | done) |
| 414 | @( \ |
| 415 | for ident in $(STRUCTS) ; do \ |
| 416 | id=`echo $$ident | tr _ - | sed s/v4l2-mpeg-vbi-ITV0/v4l2-mpeg-vbi-itv0-1/g` ; \ |
| 417 | echo "<indexentry><primaryie>struct <link" \ |
| 418 | "linkend='$$id'>$$ident</link></primaryie></indexentry>" >>$@ ; \ |
| 419 | done) |
| 420 | @( \ |
| 421 | echo "</index>") >>$@ |
| 422 | |