diff --git a/build.sh b/build.sh index bc7302d..79dcf5d 100755 --- a/build.sh +++ b/build.sh @@ -1,30 +1,34 @@ #!/bin/bash -cd lib -echo ============= we are in $PWD -make -error=$? -if [ 0 -ne $error ]; then - printf "in %s err %d in %s\n" $PWD $error $0 - exit $error -fi -echo -cd .. +# ------------------------------------------------------------------ -cd funcs -echo ============= we are in $PWD -make +function build +{ +echo ============= $1 ============== +curdir=${PWD} +cd $1 +make error=$? -if [ 0 -ne $error ]; then - printf "in %s err %d in %s\n" $PWD $error $0 - exit $error +cd ${curdir} + +if [ ${error} -ne 0 ] +then + echo === error on $1 = ${error} + exit fi -echo -cd .. +} + +# ------------------------------------------------------------------ + +build lib +build funcs +build tools + +# ------------------------------------------------------------------ cd tools echo -make fimg2pnm addtga2fimg mkfimg png2fimg fimgstats fimg2png +make error=$? cd .. diff --git a/tools/Makefile b/tools/Makefile index 6e45777..63cb07c 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -8,6 +8,8 @@ DEPS = ../floatimg.h ../libfloatimg.a Makefile # ---------- +all: fimg2pnm addtga2fimg mkfimg png2fimg fimgstats fimg2png + fimgstats: fimgstats.c $(DEPS) gcc -g $< ../libfloatimg.a -o $@ diff --git a/v4l2/Makefile b/v4l2/Makefile new file mode 100644 index 0000000..8598717 --- /dev/null +++ b/v4l2/Makefile @@ -0,0 +1,9 @@ + + +COPT = -Wall -fpic -g -DDEBUG_LEVEL=1 +DEPS = ../floatimg.h ../libfloatimg.a Makefile + + + +t: t.c Makefile ${DEPS} + gcc ${COPT} $< ../libfloatimg.a -o $@ \ No newline at end of file diff --git a/v4l2/t b/v4l2/t new file mode 100755 index 0000000..3271183 Binary files /dev/null and b/v4l2/t differ diff --git a/v4l2/t.c b/v4l2/t.c new file mode 100644 index 0000000..5845c98 --- /dev/null +++ b/v4l2/t.c @@ -0,0 +1,46 @@ +/* + * tests pour capturer les webcams + */ + +#include +#include +#include +#include +#include + +#include "floatimg.h" + +int verbosity; + +/* --------------------------------------------------------------------- */ +void help(int k) +{ +puts("Options :"); +puts("\t-d WxH\timage size"); +puts("\t-v\tincrease verbosity"); +exit(0); +} +/* --------------------------------------------------------------------- */ + +int main(int argc, char *argv[]) +{ +int foo, opt; +int W = 800, H = 600; +double tb; +int K = 0; + +while ((opt = getopt(argc, argv, "hK:v")) != -1) { + switch(opt) { + case 'h': help(0); break; + case 'K': K = atol(optarg); break; + case 'v': verbosity++; break; + } + } + +if (verbosity) fimg_print_version(0); + +return 0; +} +/* --------------------------------------------------------------------- */ + +