starpu_check_refs.sh 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #!/bin/bash
  2. # StarPU --- Runtime system for heterogeneous multicore architectures.
  3. #
  4. # Copyright (C) 2016-2019 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. #grep --exclude-dir=.git --binary-files=without-match -rsF "\ref" $dirname/../chapters|grep -v "\\ref [a-zA-Z]"
  22. #echo continue && read
  23. GREP="grep --exclude-dir=.git --binary-files=without-match -rsF"
  24. 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)
  25. find $dirname/../chapters -name "*doxy" -exec cat {} \; > /tmp/DOXYGEN_$$
  26. cat $dirname/../refman.tex >> /tmp/DOXYGEN_$$
  27. find $dirname/../../../include -name "*h" -exec cat {} \; >> /tmp/DOXYGEN_$$
  28. find $dirname/../../../starpurm/include -name "*h" -exec cat {} \; >> /tmp/DOXYGEN_$$
  29. find $dirname/../../../mpi/include -name "*h" -exec cat {} \; >> /tmp/DOXYGEN_$$
  30. find $dirname/../../../sc_hypervisor/include -name "*h" -exec cat {} \; >> /tmp/DOXYGEN_$$
  31. stcolor=$(tput sgr0)
  32. redcolor=$(tput setaf 1)
  33. greencolor=$(tput setaf 2)
  34. for r in $REFS
  35. do
  36. ref=$(echo $r | sed 's/\\ref:\(.*\):/\1/')
  37. if test -n "$ref"
  38. then
  39. #echo "ref $ref"
  40. for keyword in "section " "anchor " "ingroup " "defgroup " "def " "struct " "label{"
  41. do
  42. n=$($GREP -crs "${keyword}${ref}" /tmp/DOXYGEN_$$)
  43. if test $n -ne 0
  44. then
  45. break
  46. fi
  47. done
  48. if test $n -eq 0
  49. then
  50. echo "${redcolor}$ref${stcolor} is missing"
  51. else
  52. true
  53. #echo "${greencolor}$ref${stcolor} is ok"
  54. fi
  55. fi
  56. done