#!/bin/bash
#  
#   First we need to get into the main directory
#
if [[  ! -d ./bin  ]]; then
    cd ../
    if [[ ! -d ./bin ]]; then
	echo "Error: sumall must be executed from the main, or bin directory"
	exit
    fi
fi
if [[ ! -d Source ]]; then
    echo "Error: Source directory not found"
    exit
fi
cd ./Source
make ../bin/sum_html >& /dev/null
cd ..
if [[ ! -d SubProcesses ]]; then
    echo "Error: SubProcesses directory not found"
    exit
fi
cd SubProcesses
for i in P*_* ; do
cd $i
../../bin/sum_html >/dev/null
cd ..
done
../bin/sum_html
