summaryrefslogtreecommitdiffstats
path: root/util/make-sym-extractor
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-12-03 19:23:35 +0100
committerMattias Andrée <maandree@kth.se>2023-12-03 19:23:35 +0100
commitc131f122778c62f920a99bbf854ced4a37ee8b03 (patch)
tree14c933f98f4d64dffb0a594bc40dd5121c6c5a8e /util/make-sym-extractor
downloadlibsyscalls-c131f122778c62f920a99bbf854ced4a37ee8b03.tar.gz
libsyscalls-c131f122778c62f920a99bbf854ced4a37ee8b03.tar.bz2
libsyscalls-c131f122778c62f920a99bbf854ced4a37ee8b03.tar.xz
First commit
Signed-off-by: Mattias Andrée <maandree@kth.se>
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