diff options
| author | Hans Verkuil <hverkuil@xs4all.nl> | 2007-02-27 23:33:56 +0100 |
|---|---|---|
| committer | Hans Verkuil <hverkuil@xs4all.nl> | 2007-02-27 23:33:56 +0100 |
| commit | 48b48aad8f2170c48618958d828ea1df98a87bcd (patch) | |
| tree | df1022ba05f24e3cf4c828ef0264137a9a6ee789 /v4l2-apps/util/Makefile | |
| parent | 26838e3bee19eff7cc46636a7ca019bf93cbee1d (diff) | |
| download | mediapointer-dvb-s2-48b48aad8f2170c48618958d828ea1df98a87bcd.tar.gz mediapointer-dvb-s2-48b48aad8f2170c48618958d828ea1df98a87bcd.tar.bz2 | |
Generate driver IDs and chip IDs from the headers and use that in v4l2-dbg.
From: Hans Verkuil <hverkuil@xs4all.nl>
Instead of a hand-coded list the driver IDs and chip idents are generated
automatically from the corresponding headers.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'v4l2-apps/util/Makefile')
| -rw-r--r-- | v4l2-apps/util/Makefile | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/v4l2-apps/util/Makefile b/v4l2-apps/util/Makefile index f13773c70..fcc193a09 100644 --- a/v4l2-apps/util/Makefile +++ b/v4l2-apps/util/Makefile @@ -9,7 +9,7 @@ binaries = v4l2-ctl v4l2-dbg all: $(binaries) qv4l2 keytable clean:: - rm -f $(binaries) + rm -f $(binaries) v4l2-driverids.cpp v4l2-chipids.cpp -if [ -f qv4l2/Makefile ]; then make -C qv4l2 $@; fi -rm -f qv4l2/qv4l2 qv4l2/Makefile @@ -17,6 +17,9 @@ qv4l2: if [ ! -f qv4l2/Makefile ]; then (cd qv4l2; qmake); fi make -C qv4l2 +v4l2-dbg: v4l2-dbg.o v4l2-driverids.o v4l2-chipids.o + $(CXX) $^ -o $@ + install: include ../Make.rules @@ -39,3 +42,13 @@ keytables: ./gen_keytables.pl ../../linux/drivers/media/common/ir-keymaps.c keytable: keytable.c parse.h keytables + +v4l2-driverids.cpp: ../../linux/include/linux/i2c-id.h + @echo "struct driverid { const char *name; unsigned id; } driverids[] = {" >$@ + @grep I2C_DRIVERID_ $^ | sed -e 's/.*I2C_DRIVERID_\([0-9A-Z_]*\)[^0-9]*\([0-9]*\).*/{ "\1", \2 },/' | tr A-Z a-z >>$@ + @echo "{ 0, 0 }};" >>$@ + +v4l2-chipids.cpp: ../../linux/include/media/v4l2-chip-ident.h + @echo "struct chipid { const char *name; unsigned id; } chipids[] = {" >$@ + @grep V4L2_IDENT_ $^ | sed -e 's/.*V4L2_IDENT_\([0-9A-Z_]*\)[^=]*=[^0-9]*\([0-9]*\).*/{ "\1", \2 },/' | tr A-Z a-z >>$@ + @echo "{ 0, 0 }};" >>$@ |
