#!/bin/sh
#	Clean [dir]...
# This is a recursive cleanup script.  Give it one or more directory names,
# and it will do a "make clean" in all of them that contain a makefile with
# a "clean:" entry.  It does the job recursively, cleaning out subdirectories.
# If no directories are named, the current directory (and its subdirectories)
# will be cleaned.  Note that, since we use find, we don't follow symbolic
# links.  This is useful to prevent infinite recursion and cleaning up a
# directory more than once, but it has its problems.  See also the "Clean"
# script, which does the job a different way.
#
if [ $# -lt 1 ];then set .;fi
c=`pwd`
for d
do	find $d -type d -exec CleanDir {} \;
done
