#!/bin/tcsh -f

# remove the contents of ESP/contributed
echo ""
echo "Removing old contents of ESP/contributed..."
/bin/rm -fv $ESP_ROOT/ESP/contributed/*

# copy the .png files from the contributed/* directories into ESP/contributed
echo ""
echo "Copying .png files into ESP/contributed..."
foreach f (*/*.png)
   /bin/cp -v $f $ESP_ROOT/ESP/contributed
end

# copy the .csm files from the contributed/* directories into ESP/contributed
echo ""
echo "Copying .csm files into ESP/contributed..."
foreach f (*/*.csm)
   /bin/cp -v $f $ESP_ROOT/ESP/contributed
end

echo ""
echo "Adding .txt extension to.csm files..."
foreach f ($ESP_ROOT/ESP/contributed/*.csm)
   /bin/mv -v $f $f.txt
end

# copy the .csm files from the contributed/* directories into ESP/contributed
echo ""
echo "Copying .txt files into ESP/contributed..."
foreach f (*/*.txt)
   /bin/cp -v $f $ESP_ROOT/ESP/contributed
end

# build contributed.html given the names of all the .hlp files, followed by the .csm files
echo ""
echo "Building ESP/contributed/contributed.html..."
clang updateHelper.c -o updateHelper
./updateHelper udp*/*.hlp udf*/*.hlp
/bin/rm updateHelper

echo ""
echo "Complete"






