blob: 2432edfa75f25d30578409d8f5a08f377d928029 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001#!/bin/sh
2##===- utils/getsrcs.sh - Counts Lines Of Code ---------------*- Script -*-===##
3#
4# The LLVM Compiler Infrastructure
5#
6# This file was developed by Chris Lattner and Reid Spencer and is distributed
7# under the # University of Illinois Open Source License. See LICENSE.TXT for
8# details.
9#
10##===----------------------------------------------------------------------===##
11#
12# This script just prints out the path names for all the source files in LLVM.
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.
16#
17# Note that the implementation is based on llvmdo. See that script for more
18# details.
19##===----------------------------------------------------------------------===##
20
21if test "$1" = "-topdir" ; then
22 TOPDIR="$2"
23 shift; shift;
24else
25 TOPDIR=`llvm-config --src-root`
26fi
27
28if test -d "$TOPDIR" ; then
29 cd $TOPDIR
30 ./utils/llvmdo -topdir "$TOPDIR" \
31 -dirs "include lib tools utils examples projects" echo
32else
33 echo "Can't find LLVM top directory"
34fi