dumpsections.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/bash
  2. # TIGCC Documentation Tools
  3. #
  4. # Copyright (C) 2002-2004 Sebastian Reichelt
  5. # Copyright (C) 2008 Kevin Kofler
  6. #
  7. # This program is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 2, or (at your option)
  10. # any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program; if not, write to the Free Software Foundation,
  19. # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  20. rm -f DumpSections.out
  21. for f in "$1"/*.hss ; do
  22. title=`grep '^Title=' "$f" | sed -e 's/^Title=//g'`
  23. if [ -n "$title" ] ; then
  24. case "$title" in
  25. .*)
  26. echo ' else if (Ref.contains("'"$title"'"))' >>DumpSections.out
  27. ;;
  28. *)
  29. case "$1" in
  30. *cpp*)
  31. echo ' else if (Ref == "'"$title"'")' >>DumpSections.out
  32. ;;
  33. *)
  34. echo ' else if (Ref == "'"$title,,$title"'")' >>DumpSections.out
  35. ;;
  36. esac
  37. ;;
  38. esac
  39. fb=`basename "$f"`
  40. echo ' Result = "'`basename $1`/"${fb%.hss}"\"\; >>DumpSections.out
  41. fi
  42. done