[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <05a5bccbc72f5e7a2fc1ba018c507e3fb56a779b.1453809420.git.jani.nikula@intel.com>
Date: Tue, 26 Jan 2016 14:08:52 +0200
From: Jani Nikula <jani.nikula@...el.com>
To: Jonathan Corbet <corbet@....net>, linux-doc@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, Jani Nikula <jani.nikula@...el.com>,
Daniel Vetter <daniel.vetter@...ll.ch>
Subject: [RFC 07/10] scripts: add tool for generating asciidoc dependencies and rules
Given a list of special format filenames, generate dependencies and
rules for kernel-doc invocation on those files, to be included in to
Makefiles.
Signed-off-by: Jani Nikula <jani.nikula@...el.com>
---
scripts/kernel-doc-deps | 66 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 66 insertions(+)
create mode 100755 scripts/kernel-doc-deps
diff --git a/scripts/kernel-doc-deps b/scripts/kernel-doc-deps
new file mode 100755
index 000000000000..c348863b9354
--- /dev/null
+++ b/scripts/kernel-doc-deps
@@ -0,0 +1,66 @@
+#!/bin/bash
+
+SRCTREE=
+DSTTREE=
+DEP=
+KERNELDOC=
+TOOL=kernel-doc-helper
+
+while getopts "k:t:s:d:m:" opt; do
+ case "$opt" in
+ k)
+ KERNELDOC="$OPTARG"
+ ;;
+ t)
+ TOOL="$OPTARG"
+ ;;
+ s)
+ SRCTREE="$OPTARG/"
+ ;;
+ d)
+ DSTTREE="$OPTARG/"
+ ;;
+ m)
+ DEP="$OPTARG"
+ ;;
+ *)
+ echo "fail"
+ exit 1
+ esac
+done
+shift `expr $OPTIND - 1`
+
+ACTION="\tmkdir \$()\n\t${TOOL} -w \$@ \$^ > \$@"
+
+# $1 = filename
+# $2 = for what type
+print_rule()
+{
+ echo "$1: $2"
+ echo -e "\tmkdir -p \$(dir \$@)"
+ echo -e "\t${TOOL} -k ${KERNELDOC} -w \$@ \$^ > \$@"
+ echo "$DEP: $1"
+}
+
+# given a list of filenames with special notation, generate deps
+
+while read file; do
+ case $file in
+ # all of these are C/H source files
+ *,export)
+ print_rule "${DSTTREE}$file" "${SRCTREE}${file%,export}"
+ ;;
+ *,internal)
+ print_rule "${DSTTREE}$file" "${SRCTREE}${file%,internal}"
+ ;;
+ *,function,*)
+ print_rule "${DSTTREE}$file" "${SRCTREE}${file%,function,*}"
+ ;;
+ *,doc,*)
+ print_rule "${DSTTREE}$file" "${SRCTREE}${file%,doc,*}"
+ ;;
+ *)
+ print_rule "${DSTTREE}/${file%,txt,} " "${SRCTREE}${file%,F,*}"
+ ;;
+ esac
+done
--
2.1.4
Powered by blists - more mailing lists