#!/bin/bash

for target in spch multicmp comp dep exec pp un icmake icmbuild 
do
    cd $target
    echo dir: $target

     files=`ag -l '#include <bobcat'`
     if [ "$files" != "" ] ; then            # target contains files including
                                             # bobcat headers
 
         for file in $files ; do
             path=`echo "$file" | sed 's,[^/],,g' | sed 's,/,../,g'`
             path="../${path}support"
             echo "$file"
             sed -i 's,#include <bobcat/\(.*\)>,#include "'${path}'/\1/\1",' $file
         done
     fi

    cd ..
done
