mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
Fixed to actually work correctly and be the basis for other tools by
allowing the set of directories searched to be specified either by the LLVMDO_DIRS env var or by the -dirs "dirs..." command line option. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16441 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
48
utils/llvmdo
48
utils/llvmdo
@@ -1,32 +1,62 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# This is useful because it prints out all of the source files. Useful for
|
# This is useful because it prints out all of the source files. Useful for
|
||||||
# greps.
|
# greps.
|
||||||
|
|
||||||
|
if test $# -lt 1 ; then
|
||||||
|
echo "Usage: llvmdo [-dirs "DIRNAMES..."] PROGRAM ARGS...";
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "$1" = "-dirs" ; then
|
||||||
|
LLVMDO_DIRS="$2";
|
||||||
|
shift ; shift
|
||||||
|
elif test -z "$LLVMDO_DIRS" ; then
|
||||||
|
LLVMDO_DIRS="include lib tools test utils docs examples projects"
|
||||||
|
fi
|
||||||
PROGRAM=`which $1`
|
PROGRAM=`which $1`
|
||||||
if [ ! -x "$PROGRAM" ]; then
|
if test ! -x "$PROGRAM" ; then
|
||||||
echo "Can't execute $1"
|
echo "Can't execute $1"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
shift;
|
shift;
|
||||||
ARGS="$*"
|
ARGS="$*"
|
||||||
TOPDIR=`pwd | sed -e 's#(.*/llvm).*#$1#'`
|
TOPDIR=`pwd | sed -e 's#\(.*/llvm\).*#\1#'`
|
||||||
if test -d "$TOPDIR" ; then
|
if test -d "$TOPDIR" ; then
|
||||||
cd $TOPDIR
|
cd $TOPDIR
|
||||||
echo $TOPDIR
|
find $LLVMDO_DIRS -type f \
|
||||||
find docs include lib tools utils projects -type f \
|
\( \
|
||||||
\( -path '*/doxygen/*' -o -path '*/Burg/*' \) -prune -o \
|
-path 'docs/doxygen/*' -o \
|
||||||
-name '*.[cdhyl]*' \
|
-path 'docs/CommandGuide/html/*' -o \
|
||||||
|
-path 'docs/CommandGuide/man/*' -o \
|
||||||
|
-path 'docs/CommandGuide/ps/*' -o \
|
||||||
|
-path 'docs/CommandGuide/man/*' -o \
|
||||||
|
-path 'docs/HistoricalNotes/*' -o \
|
||||||
|
-path 'utils/Burg/*' -o \
|
||||||
|
-path 'docs/img/*' -o \
|
||||||
|
-path '*/.libs/*' \
|
||||||
|
\) -prune -o \( \
|
||||||
|
-name '*.[cdhyltp]*' \
|
||||||
|
\! -name '.*' \
|
||||||
\! -name '*~' \
|
\! -name '*~' \
|
||||||
\! -name '#*' \
|
\! -name '#*' \
|
||||||
\! -name '*.ll' \
|
|
||||||
\! -name '*.lo' \
|
|
||||||
\! -name '*.d' \
|
\! -name '*.d' \
|
||||||
\! -name '*.dir' \
|
\! -name '*.dir' \
|
||||||
|
\! -name '*.flc' \
|
||||||
|
\! -name '*.inc' \
|
||||||
|
\! -name '*.ll' \
|
||||||
|
\! -name '*.llx' \
|
||||||
|
\! -name '*.la' \
|
||||||
|
\! -name '*.lo' \
|
||||||
\! -name 'Sparc.burm.c' \
|
\! -name 'Sparc.burm.c' \
|
||||||
\! -name 'llvmAsmParser.cpp' \
|
\! -name 'llvmAsmParser.cpp' \
|
||||||
\! -name 'llvmAsmParser.h' \
|
\! -name 'llvmAsmParser.h' \
|
||||||
\! -name 'FileParser.cpp' \
|
\! -name 'FileParser.cpp' \
|
||||||
\! -name 'FileParser.h' \
|
\! -name 'FileParser.h' \
|
||||||
-exec $PROGRAM $ARGS {} \;
|
\! -name 'StackerParser.h' \
|
||||||
|
\! -name 'StackerParser.cpp' \
|
||||||
|
-exec $PROGRAM $ARGS {} \; \
|
||||||
|
\)
|
||||||
else
|
else
|
||||||
echo "Can't find LLVM top directory in $TOPDIR"
|
echo "Can't find LLVM top directory in $TOPDIR"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user