getsrcs.sh 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh
  2. ##===- utils/getsrcs.sh - Counts Lines Of Code ---------------*- Script -*-===##
  3. #
  4. # The LLVM Compiler Infrastructure
  5. #
  6. # This file is distributed under the University of Illinois Open Source
  7. # License. See LICENSE.TXT for details.
  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. if test "$1" = "-topdir" ; then
  21. TOPDIR="$2"
  22. shift; shift;
  23. else
  24. TOPDIR=`llvm-config --src-root`
  25. fi
  26. if test -d "$TOPDIR" ; then
  27. cd $TOPDIR
  28. ./utils/llvmdo -topdir "$TOPDIR" \
  29. -dirs "include lib tools utils examples projects" echo
  30. else
  31. echo "Can't find LLVM top directory"
  32. fi