#!/bin/bash
#
#  Let's compile some samples of OpenCV
#  2010/09/13 kameda[at]iit.tsukuba.ac.jp
#

#-------- OpenCV Programming Book 2nd Ed. -------
# cv_prog11.zip

mkfilename=Makefile-c_and_cpp

if [ ! -f ../${mkfilename} ] ; then
  echo ../${mkfilename} not found.
  exit 0
fi

echo "Compile samples of OpenCV Programming book 2nd Ed. in 5 seconds..."
sleep 5

cd cv11_prog
for d in s[2-4]* ; do
  pushd $d >/dev/null
  echo "Compiling codes in $d ..."
  \rm -f ${mkfilename}
  cp -p ../../../${mkfilename} .
  make clean -f ${mkfilename}
  make all   -f ${mkfilename}
  popd >/dev/null
done

exit 0

