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

Srikavin Ramkumar srikavinramkumar at gmail.com
Sat Aug 21 13:51:58 UTC 2021


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

 This works, but I'm not sure if this is the best place to place generated
 source files.

 maint/gen/generate.in |  1 +
 maint/gen/generate.sh | 10 ++++++++++
 2 files changed, 11 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..1325b26b7
--- /dev/null
+++ b/maint/gen/generate.sh
@@ -0,0 +1,10 @@
+#!/bin/sh -euf
+
+make
+
+mkdir -p ../../src/gen
+
+while IFS="$(printf '\t')" read in out; do
+	echo "generating ../../src/gen/gen_$out"
+	./gen "$in" "../../src/gen/gen_$out"
+done < generate.in
-- 
2.25.1



More information about the Strace-devel mailing list