summaryrefslogtreecommitdiff
path: root/v4l2-spec/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'v4l2-spec/Makefile')
-rw-r--r--v4l2-spec/Makefile75
1 files changed, 65 insertions, 10 deletions
diff --git a/v4l2-spec/Makefile b/v4l2-spec/Makefile
index 8f40e8614..f593faccd 100644
--- a/v4l2-spec/Makefile
+++ b/v4l2-spec/Makefile
@@ -5,6 +5,8 @@ SHELL=/bin/bash
SGMLS = \
biblio.sgml \
capture.c.sgml \
+ keytable.c.sgml \
+ v4l2grab.c.sgml \
common.sgml \
compat.sgml \
controls.sgml \
@@ -20,6 +22,8 @@ SGMLS = \
dev-sliced-vbi.sgml \
dev-teletext.sgml \
driver.sgml \
+ libv4l.sgml \
+ remote_controllers.sgml \
entities.sgml \
fdl-appendix.sgml \
func-close.sgml \
@@ -117,8 +121,12 @@ WARN =
#WARN = -w all -w duplicate -w net
# Stylesheet customization.
+ # docbook/db2 syntax
CUSTOM_HTML = --dsl custom.dsl\#html
CUSTOM_PRINT = --dsl custom.dsl\#print
+ # xmlto syntax
+CUSTOM_HTML_XMLTO = -m custom.xsl
+CUSTOM_PRINT_XMLTO = -m custom.xsl
all: capture html-single
@@ -128,6 +136,12 @@ html-single: html-single-build.stamp
pdf: pdf-build.stamp
+man: man-build.stamp
+
+man_install: man-build.stamp
+ install -d /usr/local/man/man2
+ install -b man/* /usr/local/man/man2
+
coffeebreak: all html pdf
FUNCS = \
@@ -243,6 +257,7 @@ ENUMS = \
v4l2_power_line_frequency \
v4l2_priority \
v4l2_tuner_type \
+ v4l2_preemphasis \
STRUCTS = \
v4l2_audio \
@@ -305,6 +320,7 @@ ERRORS = \
EINVAL \
ENFILE \
ENOMEM \
+ ENOSPC \
ENOTTY \
ENXIO \
EMFILE \
@@ -321,7 +337,14 @@ DOCUMENTED = \
-e "s/\(enum *\)v4l2_mpeg_cx2341x_video_\([a-z]*_spatial_filter_type\)/\1<link linkend=\"\2\">v4l2_mpeg_cx2341x_video_\2<\/link>/g" \
-e "s/\(\(enum\|struct\) *\)\(v4l2_[a-zA-Z0-9_]*\)/\1<link linkend=\"\3\">\3<\/link>/g" \
-e "s/\(V4L2_PIX_FMT_[A-Z0-9_]\+\) /<link linkend=\"\1\">\1<\/link> /g" \
- -e ":a;s/\(linkend=\".*\)_\(.*\">\)/\1-\2/;ta"
+ -e ":a;s/\(linkend=\".*\)_\(.*\">\)/\1-\2/;ta" \
+ -e "s/(linkend=\")v4l2-mpeg-vbi-ITV0/\1)v4l2_mpeg_vbi_itv0-1/g"
+
+libv4l-fmt.sgml:
+ cat ../v4l2-apps/libv4l/libv4lconvert/*.c| \
+ perl -ne 'if (m/(V4L2_PIX_FMT_[^\s\;\\)\,:]+)/) { printf "<link linkend=\"$$1\"><constant>$$1</constant></link>,\n"; };' \
+ |sort|uniq| \
+ sed -e ":a;s/\(linkend=\".*\)_\(.*\">\)/\1-\2/;ta" > $@
capture.c.sgml: ../v4l2-apps/test/capture-example.c Makefile
echo "<programlisting>" > $@
@@ -330,6 +353,20 @@ capture.c.sgml: ../v4l2-apps/test/capture-example.c Makefile
sed 's/i\.e\./&ie;/' >> $@
echo "</programlisting>" >> $@
+v4l2grab.c.sgml: ../v4l2-apps/test/v4l2grab.c Makefile
+ echo "<programlisting>" > $@
+ expand --tabs=8 < $< | \
+ sed $(ESCAPE) $(DOCUMENTED) | \
+ sed 's/i\.e\./&ie;/' >> $@
+ echo "</programlisting>" >> $@
+
+keytable.c.sgml: ../v4l2-apps/util/keytable.c Makefile
+ echo "<programlisting>" > $@
+ expand --tabs=8 < $< | \
+ sed $(ESCAPE) $(DOCUMENTED) | \
+ sed 's/i\.e\./&ie;/' >> $@
+ echo "</programlisting>" >> $@
+
videodev2.h.sgml: ../linux/include/linux/videodev2.h Makefile
echo "<programlisting>" > $@
expand --tabs=8 < $< | \
@@ -443,10 +480,14 @@ indices.sgml: Makefile
# HTML version.
html-build.stamp: Makefile checks $(SGMLS) $(GIFPICS)
rm -rf v4l2
- if which docbook2html >/dev/null ; then \
- docbook2html $(WARN) $(CUSTOM_HTML) --output v4l2 v4l2.sgml ; \
+ if which xmlto >/dev/null ; then \
+ xmlto xhtml $(WARN) $(CUSTOM_HTML_XMLTO) -o v4l2 v4l2.sgml ; \
+ elif which docbook2html >/dev/null ; then \
+ export DCL="--dcl `find /usr/share/sgml -name xml.dcl |head -1`"; \
+ docbook2html $(WARN) $$DCL $(CUSTOM_HTML) --output v4l2 v4l2.sgml ; \
else \
- db2html $(WARN) $(CUSTOM_HTML) --output v4l2 v4l2.sgml ; \
+ export DCL="--dcl `find /usr/share/sgml -name xml.dcl |head -1`"; \
+ db2html $(WARN) $$DCL $(CUSTOM_HTML) --output v4l2 v4l2.sgml ; \
fi
cp $(GIFPICS) v4l2/
cd v4l2 ; \
@@ -460,11 +501,15 @@ html-build.stamp: Makefile checks $(SGMLS) $(GIFPICS)
# is more convenient than clicking through dozens of pages.
html-single-build.stamp: Makefile checks $(SGMLS) $(GIFPICS)
rm -rf v4l2-single
- if which docbook2html >/dev/null; then \
- docbook2html $(WARN) $(CUSTOM_HTML) --nochunks \
+ if which xmlto >/dev/null ; then \
+ xmlto html-nochunks $(WARN) $(CUSTOM_HTML_XMLTO) -o v4l2-single v4l2.sgml ; \
+ elif which docbook2html >/dev/null ; then \
+ export DCL="--dcl `find /usr/share/sgml -name xml.dcl |head -1`"; \
+ docbook2html $$DCL $(WARN) $(CUSTOM_HTML) --nochunks \
--output v4l2-single v4l2.sgml ; \
else \
- db2html $(WARN) $(CUSTOM_HTML) --nochunks \
+ export DCL="--dcl `find /usr/share/sgml -name xml.dcl |head -1`"; \
+ db2html $$DCL $(WARN) $(CUSTOM_HTML) --nochunks \
--output v4l2-single v4l2.sgml ; \
fi
cp $(GIFPICS) v4l2-single/
@@ -473,13 +518,22 @@ html-single-build.stamp: Makefile checks $(SGMLS) $(GIFPICS)
# For printing.
pdf-build.stamp: Makefile checks $(SGMLS) $(PDFPICS)
- if which docbook2pdf >/dev/null; then \
- docbook2pdf $(WARN) $(CUSTOM_PRINT) v4l2.sgml ; \
+ if which db2pdf >/dev/null ; then \
+ export DCL="--dcl `find /usr/share/sgml -name xml.dcl|head -1`"; \
+ db2pdf $$DCL $(WARN) $(CUSTOM_PRINT) v4l2.sgml ; \
+ elif which xmlto >/dev/null ; then \
+ xmlto pdf $(WARN) $(CUSTOM_HTML_XMLTO) -o v4l2-single v4l2.sgml ; \
else \
- db2pdf $(WARN) $(CUSTOM_PRINT) v4l2.sgml ; \
+ export DCL="--dcl `find /usr/share/sgml -name xml.dcl |head -1`"; \
+ docbook2pdf $$DCL $(WARN) $(CUSTOM_PRINT) v4l2.sgml ; \
fi
touch pdf-build.stamp
+
+# For man
+man-build.stamp: Makefile checks $(SGMLS) $(PDFPICS)
+ xmlto man $(WARN) $(CUSTOM_HTML_XMLTO) -o man v4l2.sgml
+
# Example.
capture: ../v4l2-apps/test/capture-example.c
gcc $^ -o $@
@@ -488,6 +542,7 @@ distclean clean:
rm -f *.stamp
rm -f videodev2.h.sgml
rm -f capture.c.sgml
+ rm -f v4l2grab.c.sgml
rm -f capture
rm -f indices.sgml entities.sgml
rm -rf v4l2 v4l2-single v4l2.pdf