Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1 | #!/bin/sh |
Reid Spencer | 181e65d | 2004-09-20 08:09:36 +0000 | [diff] [blame] | 2 | ##===- utils/getsrcs.sh - Counts Lines Of Code ---------------*- Script -*-===## |
| 3 | # |
| 4 | # The LLVM Compiler Infrastructure |
| 5 | # |
Chris Lattner | 3060910 | 2007-12-29 20:37:13 +0000 | [diff] [blame] | 6 | # This file is distributed under the University of Illinois Open Source |
| 7 | # License. See LICENSE.TXT for details. |
Reid Spencer | 181e65d | 2004-09-20 08:09:36 +0000 | [diff] [blame] | 8 | # details. |
| 9 | # |
| 10 | ##===----------------------------------------------------------------------===## |
| 11 | # |
| 12 | # This script just prints out the path names for all the source files in LLVM. |
Reid Spencer | ca7592a | 2006-08-14 18:49:05 +0000 | [diff] [blame] | 13 | # The optional -topdir option can be used to specify the top LLVM source |
| 14 | # directory. Without it, the llvm-config command is consulted to find the |
| 15 | # top source directory. |
Reid Spencer | 181e65d | 2004-09-20 08:09:36 +0000 | [diff] [blame] | 16 | # |
| 17 | # Note that the implementation is based on llvmdo. See that script for more |
| 18 | # details. |
| 19 | ##===----------------------------------------------------------------------===## |
| 20 | |
Reid Spencer | 920baee | 2006-08-15 03:50:10 +0000 | [diff] [blame] | 21 | if test "$1" = "-topdir" ; then |
| 22 | TOPDIR="$2" |
| 23 | shift; shift; |
| 24 | else |
| 25 | TOPDIR=`llvm-config --src-root` |
Reid Spencer | ca7592a | 2006-08-14 18:49:05 +0000 | [diff] [blame] | 26 | fi |
| 27 | |
Reid Spencer | b27b78f | 2004-09-20 07:22:23 +0000 | [diff] [blame] | 28 | if test -d "$TOPDIR" ; then |
| 29 | cd $TOPDIR |
Reid Spencer | ca7592a | 2006-08-14 18:49:05 +0000 | [diff] [blame] | 30 | ./utils/llvmdo -topdir "$TOPDIR" \ |
| 31 | -dirs "include lib tools utils examples projects" echo |
Reid Spencer | b27b78f | 2004-09-20 07:22:23 +0000 | [diff] [blame] | 32 | else |
Reid Spencer | ca7592a | 2006-08-14 18:49:05 +0000 | [diff] [blame] | 33 | echo "Can't find LLVM top directory" |
Reid Spencer | b27b78f | 2004-09-20 07:22:23 +0000 | [diff] [blame] | 34 | fi |