[PATCH v2 2/3] maint: add script to generate decoders from definitions

Srikavin Ramkumar srikavinramkumar at gmail.com
Wed Sep 8 15:36:53 UTC 2021


* maint/gen/generate.in: New file.
* maint/gen/generate.sh: Likewise.
---

Changes since V1:
    * maint/gen/generate.sh: Specify make target, Remove IFS, Add OUTPUT_PATH variable.

 maint/gen/generate.in |  1 +
 maint/gen/generate.sh | 12 ++++++++++++
 2 files changed, 13 insertions(+)
 create mode 100644 maint/gen/generate.in
 create mode 100755 maint/gen/generate.sh

diff --git a/maint/gen/generate.in b/maint/gen/generate.in
new file mode 100644
index 000000000..24700ed74
--- /dev/null
+++ b/maint/gen/generate.in
@@ -0,0 +1 @@
+defs/hdio.def	hdio.c
diff --git a/maint/gen/generate.sh b/maint/gen/generate.sh
new file mode 100755
index 000000000..083b0c52a
--- /dev/null
+++ b/maint/gen/generate.sh
@@ -0,0 +1,12 @@
+#!/bin/sh -euf
+
+OUTPUT_PATH=../../src/gen
+
+make all
+
+mkdir -p "$OUTPUT_PATH"
+
+while read -r in out; do
+	echo "generating $OUTPUT_PATH/gen_$out" 1>&2
+	./gen "$in" "$OUTPUT_PATH/gen_$out"
+done < generate.in
-- 
2.25.1



More information about the Strace-devel mailing list