Don't include libtool "object" files
[oota-llvm.git] / utils / llvmdo
1 #!/bin/sh
2 # This is useful because it prints out all of the source files.  Useful for
3 # greps.
4 PROGRAM=`which $1`
5 if [ ! -x "$PROGRAM" ]; then
6   echo "Can't execute $1"
7   exit 1
8 fi
9 shift;
10 ARGS="$*"
11 TOPDIR=`pwd | sed -e 's#(.*/llvm).*#$1#'`
12 if test -d "$TOPDIR" ; then
13   cd $TOPDIR
14   echo $TOPDIR
15   find docs include lib tools utils projects -type f \
16       \( -path '*/doxygen/*' -o -path '*/Burg/*' \) -prune -o \
17       -name '*.[cdhyl]*' \
18       \! -name '*~' \
19       \! -name '#*' \
20       \! -name '*.ll' \
21       \! -name '*.lo' \
22       \! -name '*.d' \
23       \! -name '*.dir' \
24       \! -name 'Sparc.burm.c' \
25       \! -name 'llvmAsmParser.cpp' \
26       \! -name 'llvmAsmParser.h' \
27       \! -name 'FileParser.cpp' \
28       \! -name 'FileParser.h' \
29       -exec $PROGRAM $ARGS {} \;
30 else
31   echo "Can't find LLVM top directory in $TOPDIR"
32 fi