author: Masahiro Yamada <yamada.masahiro@socionext.com> 2018-11-30 10:05:26 +0900
committer: Masahiro Yamada <yamada.masahiro@socionext.com> 2018-12-01 23:13:14 +0900
commit: bbda5ec671d3fe62faefa1cab7270aa586042a4b
parent: ee3e46b7efd2954479f87030d31fda3c22bbc763
Commit Summary:
Diffstat:
1 file changed, 19 insertions, 0 deletions
diff --git a/scripts/gen_ksymdeps.sh b/scripts/gen_ksymdeps.sh
new file mode 100755
index 000000000000..1324986e1362
--- /dev/null
+++ b/scripts/gen_ksymdeps.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
+
+set -e
+
+# List of exported symbols
+ksyms=$($NM $1 | sed -n 's/.*__ksym_marker_\(.*\)/\1/p' | tr A-Z a-z)
+
+if [ -z "$ksyms" ]; then
+ exit 0
+fi
+
+echo
+echo "ksymdeps_$1 := \\"
+
+for s in $ksyms
+do
+ echo $s | sed -e 's:^_*: $(wildcard include/ksym/:' \
+ -e 's:__*:/:g' -e 's/$/.h) \\/'
+done
+
+echo
+echo "$1: \$(ksymdeps_$1)"
+echo
+echo "\$(ksymdeps_$1):"