#!/bin/sh
rootdir=`pwd`
#MAKEFILE=$HOME/local/lib/cpplapack/makefiles/Makefile.g++4
#MAKEFILE=$HOME/local/lib/cpplapack/makefiles/Makefile.icc8.1
MAKEFILE=$HOME/local/lib/cpplapack/makefiles/Makefile.icpc8.1
for i in `find * -type d`; do
if [ -d $i ]; then
echo "################ Enter into $i/ ################"
cd $i
if [ -f SUCCEEDED ]; then
echo "======== Skipping cause already succeeded ========"
elif [ -f main.cpp ]; then
echo "======== Making ========" &&\
make -f $MAKEFILE remake &&\
echo "======== Executing ./A.OUT ========" &&\
./A.OUT &&\
make -f $MAKEFILE fullclean
if [ $? != 0 ]; then exit 1; fi
echo "======== Succeeded ========"
touch SUCCEEDED
else
echo "======== No main.cpp ========"
fi
cd $rootdir
echo "################ Exit from $i/ ################"
fi
done