getsrcs.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/sh
  2. ##===- utils/getsrcs.sh - Counts Lines Of Code ---------------*- Script -*-===##
  3. #
  4. # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  5. # See https://llvm.org/LICENSE.txt for license information.
  6. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  7. # details.
  8. #
  9. ##===----------------------------------------------------------------------===##
  10. #
  11. # This script just prints out the path names for all the source files in LLVM.
  12. # The optional -topdir option can be used to specify the top LLVM source
  13. # directory. Without it, the llvm-config command is consulted to find the
  14. # top source directory.
  15. #
  16. # Note that the implementation is based on llvmdo. See that script for more
  17. # details.
  18. ##===----------------------------------------------------------------------===##
  19. if test "$1" = "-topdir" ; then
  20. TOPDIR="$2"
  21. shift; shift;
  22. else
  23. TOPDIR=`llvm-config --src-root`
  24. fi
  25. if test -d "$TOPDIR" ; then
  26. cd $TOPDIR
  27. ./utils/llvmdo -topdir "$TOPDIR" \
  28. -dirs "include lib tools utils examples projects" echo
  29. else
  30. echo "Can't find LLVM top directory"
  31. fi