blob: c8bff8cf833d8b8dcf29af6360b535674d724aea [file] [log] [blame]
Chris Lattner00950542001-06-06 20:29:01 +00001#!/bin/sh
Reid Spencer181e65d2004-09-20 08:09:36 +00002##===- utils/getsrcs.sh - Counts Lines Of Code ---------------*- Script -*-===##
3#
4# The LLVM Compiler Infrastructure
5#
Chris Lattner30609102007-12-29 20:37:13 +00006# This file is distributed under the University of Illinois Open Source
7# License. See LICENSE.TXT for details.
Reid Spencer181e65d2004-09-20 08:09:36 +00008# details.
9#
10##===----------------------------------------------------------------------===##
11#
12# This script just prints out the path names for all the source files in LLVM.
Reid Spencerca7592a2006-08-14 18:49:05 +000013# 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 Spencer181e65d2004-09-20 08:09:36 +000016#
17# Note that the implementation is based on llvmdo. See that script for more
18# details.
19##===----------------------------------------------------------------------===##
20
Reid Spencer920baee2006-08-15 03:50:10 +000021if test "$1" = "-topdir" ; then
22 TOPDIR="$2"
23 shift; shift;
24else
25 TOPDIR=`llvm-config --src-root`
Reid Spencerca7592a2006-08-14 18:49:05 +000026fi
27
Reid Spencerb27b78f2004-09-20 07:22:23 +000028if test -d "$TOPDIR" ; then
29 cd $TOPDIR
Reid Spencerca7592a2006-08-14 18:49:05 +000030 ./utils/llvmdo -topdir "$TOPDIR" \
31 -dirs "include lib tools utils examples projects" echo
Reid Spencerb27b78f2004-09-20 07:22:23 +000032else
Reid Spencerca7592a2006-08-14 18:49:05 +000033 echo "Can't find LLVM top directory"
Reid Spencerb27b78f2004-09-20 07:22:23 +000034fi