aboutsummaryrefslogtreecommitdiff
path: root/scripts/manifest2header.awk
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/manifest2header.awk')
-rwxr-xr-xscripts/manifest2header.awk23
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/manifest2header.awk b/scripts/manifest2header.awk
new file mode 100755
index 0000000..b141a8b
--- /dev/null
+++ b/scripts/manifest2header.awk
@@ -0,0 +1,23 @@
+#!/bin/awk -f
+BEGIN {
+ offset = 0
+ groups = 0
+ arr = "0"
+ print "#pragma once"
+ print "#include <stddef.h>"
+}
+(offset > 0) {
+ arr = arr ", " offset
+}
+1 {
+ sub(".*/", "", $1)
+ print "#define HH_TM_"toupper($1)"_OFFSET "offset
+ print "#define HH_TM_"toupper($1)"_SIZE "$2
+ groups += 1
+ offset += $2
+}
+END {
+ print "#define HH_TM_SIZE "offset
+ print "#define HH_TM_GROUPS "groups
+ print "const static uint8_t hh_palette_lut[]={"arr", NULL};"
+}