#! /bin/csh -fe # Deletes all Modula-3 derived objects below the current directory set path = ( /usr/bin /bin /usr/ucb /usr/bsd ) if ( $#argv != 0 ) then echo "Usage: $0" exit 1 endif # Delete miscellaneous object and auxiliary files, libraries, # Note: '*.1' below catches both '*.so.1' and manpages. find . -name 'src' -prune \ -o \( \ -name '*.[oa]' -o -name '*.ax' -o -name '*.[im]3x' \ -o -name '*.so' -o -name '*.1' \ -o -name '*.[im][ox]' -o -name '_m3main.c' -o -name '.M3*' \ \) -print -exec /bin/rm {} \; # Delete executables, querying user. find . -name 'src' -prune \ -o \( \ -path '*/SPARC/*' -o -path '*/SOLgnu/*' -o -path '*/IRIX5/*' \ \) -perm +a+x -ok /bin/rm {} \; # Delete derived directories, querying user. find ./ -depth -type d \ \( -name "$M3PLATFORM" -o -name 'SPARC' -o -name 'SOLgnu' -o -name 'IRIX5' -o -name 'LINUXLIBC6' \) \ -ok /bin/rmdir {} \;