#!/bin/csh -f

source build-env

#
# Go through and make stuff
#
if ( "$1" == "" ) then
  set LIST=`ls src/lib/makefile.* | grep -v "~"`
  set LIST=($LIST `ls src/methods/makefile.* | grep -v "~"`)
  set LIST=($LIST `ls src/*/makefile.* src/*/*/makefile.* | grep -v "/lib/" | grep -v "/methods/" | grep -v "~"`)
else
  set LIST=`ls src/$1/makefile.* | grep -v "~"`
endif

foreach g (${LIST})
    echo making $g ...
    pushd $g:h > /dev/null
    make -f $g:t
    popd > /dev/null
    end
