summaryrefslogtreecommitdiff
path: root/build_tools
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2009-10-11 18:24:17 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2009-10-11 18:24:17 +0000
commit2d681a1ed7cbb7d6a4d0194c8c8caee05fbaaa13 (patch)
tree63c9b67371ea659b13f52151763e55dfea9d2cab /build_tools
parentc65417597bb444057b19e43fcbbc79087b33abce (diff)
Add kernel-doc generation to the 'docs' target
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7379 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'build_tools')
-rwxr-xr-xbuild_tools/kernel-doc63
1 files changed, 63 insertions, 0 deletions
diff --git a/build_tools/kernel-doc b/build_tools/kernel-doc
new file mode 100755
index 0000000..017305c
--- /dev/null
+++ b/build_tools/kernel-doc
@@ -0,0 +1,63 @@
+#!/bin/sh
+
+# a wrapper to kernel-doc from the kernel source tree
+#
+# Copyright (C) 2009 by Xorcom <support@xorcom.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# For 'man' version: build_tools/kernel-doc -f man | man -l -
+
+files="drivers/dahdi/dahdi-base.c"
+format="html"
+kernel="/lib/modules/`uname -r`/build"
+
+usage() {
+ me=`basename $0`
+ cat <<EOF
+$me: wrapper around the kernel's kernel-doc script
+Extracts kernel-doc from $files .
+
+$me [options]
+
+Options:
+ -f --format: Alternative output format (man, text, docbook. Default: html)
+ -k --kernel: kernel source tree. Default: $kernel .
+EOF
+}
+
+options=`getopt -o f:hk: --long format:,help,kernel: -- "$@"`
+if [ $? != 0 ] ; then echo >&2 "Terminating..." ; exit 1 ; fi
+
+eval set -- "$options"
+
+while true ; do
+ case "$1" in
+ -f|--format) format="$2"; shift ;;
+ -h|--help) usage; exit 0;;
+ -k|--kernel) kernel="$2"; shift ;;
+ --) shift ; break ;;
+ esac
+ shift;
+done
+
+if [ "$*" != '' ]; then
+ files="$*" #FIXME: spaces
+fi
+
+script="$kernel/scripts/kernel-doc"
+$script -$format $files
+
+