summaryrefslogtreecommitdiffstats
path: root/util/make-sym-extractor
diff options
context:
space:
mode:
Diffstat (limited to 'util/make-sym-extractor')
-rwxr-xr-xutil/make-sym-extractor25
1 files changed, 25 insertions, 0 deletions
diff --git a/util/make-sym-extractor b/util/make-sym-extractor
new file mode 100755
index 0000000..7fec6b8
--- /dev/null
+++ b/util/make-sym-extractor
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+set -e
+
+test $# = 2
+
+symbols="$1"
+how=""
+deps=""
+set $(printf '%s\n' "$2" | tr ',|' ' ')
+
+for dep; do
+ if test "$dep" = mask || test "$dep" = enum; then
+ test -z "$how"
+ how="$dep"
+ else
+ deps="$deps $dep"
+ fi
+done
+
+test -n "$how"
+
+dir="$(dirname -- "$0")"
+
+$dir/make-$how "$symbols" $deps