starpu_check_refs.sh 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #!/bin/bash
  2. # StarPU --- Runtime system for heterogeneous multicore architectures.
  3. #
  4. # Copyright (C) 2016-2018 CNRS
  5. #
  6. # StarPU is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU Lesser General Public License as published by
  8. # the Free Software Foundation; either version 2.1 of the License, or (at
  9. # your option) any later version.
  10. #
  11. # StarPU is distributed in the hope that it will be useful, but
  12. # WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. #
  15. # See the GNU Lesser General Public License in COPYING.LGPL for more details.
  16. #
  17. stcolor=$(tput sgr0)
  18. redcolor=$(tput setaf 1)
  19. greencolor=$(tput setaf 2)
  20. dirname=$(dirname $0)
  21. STARPU_H_FILES=$(find $dirname/../../../include $dirname/../../../mpi/include -name '*.h')
  22. SC_H_FILES=$(find $dirname/../../../sc_hypervisor/include -name '*.h')
  23. SRC="$dirname/../../../src $dirname/../../../mpi/src $dirname/../../../sc_hypervisor/src"
  24. #grep --exclude-dir=.git --binary-files=without-match -rsF "\ref" $dirname/../chapters|grep -v "\\ref [a-zA-Z]"
  25. #echo continue && read
  26. GREP="grep --exclude-dir=.git --binary-files=without-match -rsF"
  27. REFS=$($GREP "\ref" $dirname/../chapters| tr ':' '\012' | tr '.' '\012' | tr ',' '\012' | tr '(' '\012' | tr ')' '\012' | tr ' ' '\012'|grep -F '\ref' -A1 | grep -v '^--$' | sed 's/\\ref/=\\ref/' | tr '\012' ':' | tr '=' '\012' | sort | uniq)
  28. find $dirname/../chapters -name "*doxy" -exec cat {} \; > /tmp/DOXYGEN_$$
  29. cat $dirname/../refman.tex >> /tmp/DOXYGEN_$$
  30. for r in $REFS
  31. do
  32. ref=$(echo $r | sed 's/\\ref:\(.*\):/\1/')
  33. n=$($GREP -crs "section $ref" /tmp/DOXYGEN_$$)
  34. if test $n -eq 0
  35. then
  36. n=$($GREP -crs "anchor $ref" /tmp/DOXYGEN_$$)
  37. if test $n -eq 0
  38. then
  39. n=$($GREP -crs "ingroup $ref" /tmp/DOXYGEN_$$)
  40. if test $n -eq 0
  41. then
  42. n=$($GREP -crs "def $ref" /tmp/DOXYGEN_$$)
  43. if test $n -eq 0
  44. then
  45. n=$($GREP -crs "struct $ref" /tmp/DOXYGEN_$$)
  46. if test $n -eq 0
  47. then
  48. if test $n -eq 0
  49. then
  50. n=$($GREP -crs "label{$ref" /tmp/DOXYGEN_$$)
  51. if test $n -eq 0
  52. then
  53. echo $ref missing
  54. fi
  55. fi
  56. fi
  57. fi
  58. fi
  59. fi
  60. fi
  61. done