kernel-doc 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #!/bin/sh
  2. # a wrapper to kernel-doc from the kernel source tree
  3. #
  4. # Copyright (C) 2009 by Xorcom <support@xorcom.com>
  5. #
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. # For 'man' version: build_tools/kernel-doc -f man | man -l -
  20. files="drivers/dahdi/dahdi-base.c"
  21. format="html"
  22. kernel="/lib/modules/`uname -r`/build"
  23. usage() {
  24. me=`basename $0`
  25. cat <<EOF
  26. $me: wrapper around the kernel's kernel-doc script
  27. Extracts kernel-doc from $files .
  28. $me [options]
  29. Options:
  30. -f --format: Alternative output format (man, text, docbook. Default: html)
  31. -k --kernel: kernel source tree. Default: $kernel .
  32. EOF
  33. }
  34. options=`getopt -o f:hk: --long format:,help,kernel: -- "$@"`
  35. if [ $? != 0 ] ; then echo >&2 "Terminating..." ; exit 1 ; fi
  36. eval set -- "$options"
  37. while true ; do
  38. case "$1" in
  39. -f|--format) format="$2"; shift ;;
  40. -h|--help) usage; exit 0;;
  41. -k|--kernel) kernel="$2"; shift ;;
  42. --) shift ; break ;;
  43. esac
  44. shift;
  45. done
  46. if [ "$*" != '' ]; then
  47. files="$*" #FIXME: spaces
  48. fi
  49. script="$kernel/scripts/kernel-doc"
  50. $script -$format $files